
Originally Posted by
papayrus
Ok so they are part of objLink already like a family but I am confused then about current directory is that part of the objLink property?
EDIT I just thought about it am thinking that no it is not because it is a directory in itself and not part of what a link would be or something like that.
For the sake of sanity and house cleaning, here's a better example to your final code above:
Code:
Option Explicit
Dim objShell, strEnvironment, objLink, CurrentDirectory
Set objShell = CreateObject("WScript.Shell")
CurrentDirectory = CreateObject("Scripting.FileSystemObject").GetAbsolutePathName(".")
' Program starts running here.
Call CreateShortCut()
Sub CreateShortCut()
strEnvironment = objShell.ExpandEnvironmentStrings("%USERPROFILE%\Start Menu\Programs\Accessories")
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