Create a Desktop shortcut using WSH





2
Date Submitted Mon. Jun. 25th, 2007 4:17 AM
Revision 1 of 1
Syntax Master sundaramkumar
Tags VBSCRIPT | wscript
Comments 0 comments
If you want to create a shortcut programatically use the code below. Found somewhere on net


'Create a Desktop ShortCut
set WshShell = WScript.CreateObject("WScript.Shell")
strDesktop = WshShell.SpecialFolders("Desktop")
set oShellLink = WshShell.CreateShortcut(strDesktop & "\Shortcut To Notepad.lnk")
oShellLink.TargetPath = "Notepad.exe" 'WScript.ScriptFullName
oShellLink.WindowStyle = 1
oShellLink.Hotkey = "CTRL+SHIFT+N"
oShellLink.IconLocation = "notepad.exe, 0"
oShellLink.Description = "Shortcut To Notepad."
oShellLink.WorkingDirectory = strDesktop
oShellLink.Save

 

Comments

There are currently no comments for this snippet.

Voting

Votes Down