I have pulled out what stubble I have as hair trying to figure this. I have some code that deletes an old desktop link and creates a new one however, the link I want created has in it's target a command and switch. Normal creation this works fine, script it and the quotes that are required are passed. Adding code to eliminate quotes results in no space between application executable and switch, add code to inject a space in ANY format results in the preceding and ending quotes showing up again... clues?
Code as follows:
'begin shortcut creation function
strAppPath = "c:\Directory\File.exe dbserver=server\instance"
Set objShell = CreateObject("WScript.Shell")
objDesktop = objShell.SpecialFolders("Desktop")
Set objLink = objShell.CreateShortcut(objDesktop & "\File.lnk")
objLink.Description = "File"
objLink.IconLocation = strIconPath
objLink.TargetPath = strAppPath
objLink.WindowStyle = 3
objLink.WorkingDirectory = strWorkDir