VBScript: Create Shortcut (.lnk) File
Submitted by Matthew Clark on Sat, 31 Oct 2009 - 14:20


Filed under:
Following is a starting point for a script which will create a standard shortcut on the desktop.
Set WshShell = CreateObject("WScript.Shell") strDesktop = WshShell.SpecialFolders("Desktop") Set oShellLink = WshShell.CreateShortcut(strDesktop & "\My Shortcut.lnk") oShellLink.TargetPath = "" ' Absolute path to the executable, file, folder, or URL oShellLink.Arguments = "" ' Optional arguments to pass to the Target (usually for executables) oShellLink.WorkingDirectory = "" ' Usually set to the parent directory of the Target oShellLink.IconLocation = "" ' Optionally specify a specific icon to use oShellLink.Description = "" ' Short description, optional oShellLink.WindowStyle = "" ' 1 = Default, 3 = Maximized, 7 = Minimized oShellLink.Hotkey = "" ' Example: CTRL+SHIFT+K oShellLink.Save

Post new comment