pphreadr
asked on
Why can I not use the colons in this shortcut creation?
Remove the Colons and it works, but I need the colons.
Option Explicit
'Enumerate all variables
Dim strDesktop, oUrlLink, WshShell, oShellLink
set WshShell = WScript.CreateObject("WScript.Shell")
strDesktop = WshShell.SpecialFolders("Desktop")
set oShellLink = WshShell.CreateShortcut(strDesktop & "\Shortcut Script.lnk")
oShellLink.TargetPath = "C:\Program Files (x86)\NaviCare Systems\NaviCare7.1\cpmnav32.exe" & " -cFLShandsUF_MGR:navicare.shands.ufl.edu:7024" & " -uOR" & " -zview"
oShellLink.WindowStyle = 1
oShellLink.Hotkey = "CTRL+SHIFT+F"
oShellLink.Description = "BedBoard"
oShellLink.WorkingDirectory = strDesktop
oShellLink.Save
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
any way to make the target and switches variables?
ASKER
Something like this. I will then read a file to set the variables.
Option Explicit
'Enumerate all variables
Dim strDesktop, oUrlLink, WshShell, oShellLink, objServer, objUser, objPasswd, objTarget
set objTarget = "C:\Program Files (x86)\NaviCare Systems\NaviCare7.1\cpmnav32.exe"
set objServer = "-cFLShandsUF_MGR:navicare.shands.ufl.edu:7024"
set objUser = "-uOR"
set objPasswd = "-zview"
set WshShell = WScript.CreateObject("WScript.Shell")
strDesktop = WshShell.SpecialFolders("Desktop")
set oShellLink = WshShell.CreateShortcut(strDesktop & "\Shortcut Script.lnk")
oShellLink.TargetPath = objTarget
oShellLink.Arguments = objServer & " " & objUser & " " & objPasswd
oShellLink.WindowStyle = 1
oShellLink.Hotkey = "CTRL+SHIFT+F"
oShellLink.Description = "BedBoard"
oShellLink.WorkingDirectory = strDesktop
oShellLink.Save
ASKER
OK, I got it.
Option Explicit
'Enumerate all variables
Dim strDesktop, oUrlLink, WshShell, oShellLink, objServer, objUser, objPasswd, objTarget
objTarget = "C:\Program Files (x86)\NaviCare Systems\NaviCare7.1\cpmnav32.exe"
objServer = "-cFLShandsUF_MGR:navicare.shands.ufl.edu:7024"
objUser = "-uOR"
objPasswd = "-zview"
set WshShell = WScript.CreateObject("WScript.Shell")
strDesktop = WshShell.SpecialFolders("Desktop")
set oShellLink = WshShell.CreateShortcut(strDesktop & "\Shortcut Script.lnk")
oShellLink.TargetPath = objTarget
oShellLink.Arguments = objServer & " " & objUser & " " & objPasswd
oShellLink.WindowStyle = 1
oShellLink.Hotkey = "CTRL+SHIFT+F"
oShellLink.Description = "BedBoard"
oShellLink.WorkingDirectory = strDesktop
oShellLink.Save
ASKER