Wscript.CreateShortcut

Create or edit a Windows Shortcut
Syntax
WscriptObject.CreateShortcut(sLinkFile)
ShortcutObject.property = "Your Value"

Example

Set WshShell = WScript.CreateObject("WScript.Shell")
Set lnk = WshShell.CreateShortcut("C:\MyShortcut.LNK")

lnk.TargetPath = "C:\Program Files\MyApp\MyProgram.EXE"
lnk.Arguments = ""
lnk.Description = "MyProgram"
lnk.HotKey = "ALT+CTRL+F"
lnk.IconLocation = "C:\Program Files\MyApp\MyProgram.EXE, 2"
lnk.WindowStyle = "1"
lnk.WorkingDirectory = "C:\Program Files\MyApp"
lnk.Save
'Clean up
Set lnk = Nothing

Similarly in Powershell:

$WshShell = New-Object -ComObject WScript.Shell
$lnk = $WshShell.CreateShortcut("$home\Desktop\DemoShortcut.lnk")
$lnk.TargetPath = "C:\demo.exe"
$lnk.Save()

The 'Description' property corresponds to the shortcut "Comment" field, this will be displayed in a tool-tip.

HotKey mappings are only usable if the shortcut is on the Desktop or in the Start Menu.
Valid hot key-options:
"ALT+", "CTRL+", "SHIFT+", and "EXT+".
"A" .. "Z", "0" .. "9", "Back", "Tab", "Clear", "Return", "Escape", "Space", and "Prior". 

Make a Free Website with Yola.