08-15-2006 11:20 AM
ECHO OFF
ECHO Creating a shortcut using VBScript
PAUSE
CreateShortcut.vbs
ECHO Shortcut creation complete...
PAUSE
Set oWS = WScript.CreateObject("WScript.Shell")strMyPath = oWS.SpecialFolders("AllUsersStartMenu")
sLinkFile = strMyPath & "\My Test Executive.LNK"
Set oLink = oWS.CreateShortcut(sLinkFile)
oLink.TargetPath = "C:\My Programs\Bin\TestExec.EXE"
oLink.Arguments = "-useExisting"
oLink.Description = "My Test Executive (Only)"
' oLink.HotKey = ""
' oLink.IconLocation = "C:\My Programs\Bin\TestExec.EXE, 2"
' oLink.WindowStyle = "1"
' oLink.WorkingDirectory = "C:\My Programs\Sequences"
oLink.Save
'CreateShortcut.vbs' is not recognized as an internal or external command, operable program or batch file.
08-16-2006 07:03 AM
Capt. Jack
vbscript executes by calling wscript.exe
So you need to execute <path>\wscript.exe <path>\your_vbscript.vbs
Hope it helps.
Antonio Lie.
08-16-2006 11:09 AM
Antonio,
Your suggestion helped me figure out what is going on. I believe there may be a feature/bug in the way the Deployment utility runs commands. I'm having the files installed in the Temp directory Installation Destination and using the <Temp> Command Directory in the Custom Commands to tell it where the files are to execute. This temp directory path resolves to "C:\Documents and Settings\<User Account>\Local Settings\Temp\". I neglected to add the path to the CreateShortcut.vbs file because I assumed that the batch file could find it since it's in the same directory as the batch file. But for some reason, it is looking for the file on the Installer drive and path for Setup.exe (see attached file), instead of the <Temp> path. This may be default windows behavior, but it seems odd that this is what happens.
I was able to get this to work using the "%USERPROFILE%\Local Settings\Temp\CreateShortcut.vbs" in the batch file.
Thanks for getting me going down the right road!
-Jack
08-16-2006 05:20 PM