Wscript.CreateShortcut

Create or edit a Windows Shortcut

SYNTAX
      WscriptObject.CreateShortcut(sLinkFile)
      ShortcutObject.property = "Your Value"

Example

   sLinkFile = "C:\MyShortcut.LNK"
   Set oWS = WScript.CreateObject("WScript.Shell")
   Set oLink = oWS.CreateShortcut(sLinkFile)
   
   oLink.TargetPath = "C:\Program Files\MyApp\MyProgram.EXE"
   oLink.Arguments = ""
   oLink.Description = "MyProgram"
   oLink.HotKey = "ALT+CTRL+F"
   oLink.IconLocation = "C:\Program Files\MyApp\MyProgram.EXE, 2"
   oLink.WindowStyle = "1"
   oLink.WorkingDirectory = "C:\Program Files\MyApp"
   oLink.Save


Related commands:



Equivalent Windows NT command:

SHORTCUT - Create a windows shortcut (.LNK file)



Back to the Top

Simon Sheppard
SS64.com