| |
r00b
Posts: 1
Score: 0
Joined: 6/7/2002
From:
Status: offline
|
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 "www.website.com"" as its target but this isn't a valid target. explorer "www.website.com" 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 & "\Twilife.lnk") SC.TargetPath = SH.ExpandEnvironmentStrings("%windir%\explorer.exe") SC.WorkingDirectory = SH.ExpandEnvironmentStrings("%windir%") SC.WindowStyle = 4 SC.IconLocation = SH.ExpandEnvironmentStrings("%windir%\explorer.exe, 0") SC.Save WScript.Echo "A shortcut to Twilife now exists on your Desktop."
|
|