Saturday, January 5, 2008

Create a Desktop Shortcut on the All Users Desktop

This script will create a shortcut on the All Users Desktop.

'VBSBOB
'http://vbsbob.blogspot.com/
'Define the All Users desktop file path.
allusersdesktop = "C:\Documents and Settings\All Users\Desktop"

set WshShell = WScript.CreateObject("WScript.Shell")
set oShellLink = WshShell.CreateShortcut(allusersdesktop & "\VBSBob.lnk")
'Define where you would like the shortcut to point to. This can be a program, Web site, etc.
oShellLink.TargetPath = "http://vbsbob.blogspot.com"
oShellLink.WindowStyle = 1
'Define what icon the shortcut should use. Here we use the explorer.exe icon.
oShellLink.IconLocation = "C:\WINDOWS\explorer.exe"
oShellLink.Description = "VBSBob"
oShellLink.WorkingDirectory = allusersdesktop
oShellLink.Save

1 comment:

Leslie Lim said...

Thanks to the writer of this article. I appreciate your effort in making this informational blogs. I know it's not easy to do this but you have done a really great job. Congrats. I'm pretty sure your readers enjoying it a lots.


Rica
www.imarksweb.org