www.rodneybeede.com "I would love to change the world, but they won't give me the source code" - unknown
 Navigation

VBS script for creating Windows Shortcuts (lnk) - Last Modified 2009-04-24 17:14 UTC - Created 2009-04-24 17:14 UTC

Save the following into a file with the extension vbs or wsh with the appropriate edits:
'Create a WshShell Object
Set WshShell = Wscript.CreateObject("Wscript.Shell")

'Create a WshShortcut Object
Set oShellLink = WshShell.CreateShortcut("aaa.lnk")

'Set the Target Path for the shortcut
oShellLink.TargetPath = "notepad.exe"

'Set the additional parameters for the shortcut
oShellLink.Arguments = "c:\windows\desktop\aaa.txt"

'Save the shortcut
oShellLink.Save

'Clean up the WshShortcut Object
Set oShellLink = Nothing