
Originally Posted by
BoOkWoRm
You need to specify the path for the shortcut, example:
Code:
objLink.TargetPath = CurrentDirectory & "\downIt.bat"
Ok this is what I have now is this good code or should I still declare WorkingDirectory and TargetPath after DIM or no need?
Code:
option explicit
' Program starts running here.
call CreateShortCut()
sub CreateShortCut()
dim objShell, strEnvironment, objLink, CurrentDirectory
set objShell = CreateObject("WScript.Shell")
strEnvironment = objShell.ExpandEnvironmentStrings("%USERPROFILE%\Start Menu\Programs\Accessories")
CurrentDirectory = CreateObject("Scripting.FileSystemObject").GetAbsolutePathName(".")
set objLink = objShell.CreateShortcut(strEnvironment & "\downIt.lnk")
objLink.Description = "Shortcut to downIt"
objLink.TargetPath = CurrentDirectory & "\downIt.bat"
objLink.WindowStyle = 1
objLink.WorkingDirectory = CurrentDirectory
objLink.Hotkey = "CTRL+SHIFT+ALT+U"
objLink.Description = "This will update the scanner from the internet."
objLink.Save
end sub