set WshShell = WScript.CreateObject("WScript.Shell")
set strDesktop = WshShell.SpecialFolders("Desktop")
set oUrlLink = WshShell.CreateShortcut(strDesktop & "\MicrosoftLink.lnk")
oUrlLink.TargetPath = "http://www.microsoft.com"
oUrlLink.Save
Save the above text in a .vbs file (use notepad) and call the vbs file from command prompt.
To create a shortcut to an exe instead of a web page, check this out
http://dotnetanalysis.blogspot.com/2011/03/create-shortcut-from-command-line.html
1 question, what if i need the script to first check if the url shortcut already exists or not on desktop? and in case of positive then create none, and case negative, create such shortcut-...??
ReplyDeleteany idea, will help.
thanks.