Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

creating windows shorcuts in vbscript

Status
Not open for further replies.

r00b

Programmer
Jun 6, 2002
1
US
hello,
i'm new to vbscript and i'd like to make a vbscript that
creates a link to a website on a user's desktop. I got the following code (below) from the internet below and modified it.
It creates a shortcut that has
"explorer " as its target but this isn't a valid target.
explorer "is a valid target but i can't figure out how to make the vbscript not output the beginning and end quotes.
If anyone could help me out or show me an easier way to do this i'd be really appreciate it.
thanks,
r00b the n00b

************************************
Dim iRes
Dim SH, SC, DPath

MT = "OK to create a shortcut to Website on your desktop?"
TT = "WHS - Create Shortcut"


iRes = MsgBox(MT, vbOKCancel + vbInformation, TT )
If iRes = vbCancel Then
WScript.Quit
End If

Set SH = WScript.CreateObject("WScript.Shell")
DPath = SH.SpecialFolders("Desktop")
Set SC = SH.CreateShortcut(DPath & &qu
 
It looks like your post was truncated. Here's an example of an Internet shortcut:

Set oShell = WScript.CreateObject("WScript.Shell")
sDesktop = oShell.SpecialFolders("Desktop")
Set oURL = oShell.CreateShortcut(sDesktop & "\Name.url")
oURL.TargetPath = "oURL.Save Jon Hawkins
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top