Question : vbscript create shortcut script, not completing script, no errors, code attached

Hi all,

my below script first creates a shortcut for users to out server share if one doesnt already exists, works fine

second deletes the default program shortcut for act if it exists, works fine

now the 3rd should create a shortcut to the act pad file if it doesnt exists
i get my message "ACT! link doesnt exist creating now!" then it doesnt do anything
i cant see why it wouldnt work either (only a beginner with vbscript mind you)

can anyone point it out to me?
Thanks
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
Dim objShell : Set objShell = CreateObject("WScript.Shell")
Dim objFSO: Set objFSO = CreateObject("Scripting.FileSystemObject")
Dim strDesktopPath, ShrtServerFolders, ShrtACT

strDesktopPath = objShell.SpecialFolders("Desktop")


If  Not objFSO.FileExists (strDesktopPath & "\Server Folders.lnk") then 'check if server folder shortcut exists
	Set ShrtServerFolders = objShell.CreateShortcut(strDesktopPath & "\Server Folders.lnk") ' create server folders link
	ShrtServerFolders.TargetPath = "\\domain.local\share"
	ShrtServerFolders.IconLocation = "c:\windows\system32\shell32.dll,85"
	ShrtServerFolders.Save 
End If

If objFSO.FileExists (strDesktopPath & "\ACT! by Sage Premium.lnk") then 'delete act program files shortcut if it exists
	msgbox "its there"
	objFSO.DeleteFile strDesktopPath & "\ACT! by Sage Premium.lnk" ' delete the link
else
msgbox "ACT! by Sage Premium.lnk doesnt exist!"
End If

If Not objFSO.FileExists (strDesktopPath & "\ACT!.lnk") then 'check if ACT pad shortcut exists
	msgbox "ACT! link doesnt exist creating now!"
	Set ShrtACT = objShell.CreateShortcut(strDesktopPath & "ACT!.lnk") ' create act pad link
	ShrtACT.TargetPath = "\\domain.local\share\ACT\CH.PAD"
	ShrtACT.IconLocation = "\\domain.local\NETLOGON\act.ico,0"
	ShrtACT.Save 

else
msgbox "ACT! Link exists"
	
End If

Answer : vbscript create shortcut script, not completing script, no errors, code attached

"Mailto:[email protected]?Subject=MySubject&Body=MyBody"
Random Solutions  
 
programming4us programming4us