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

No comments: