Photo Gallery Member List Search Calendars FAQ Ticket List Log Out


creating windows shortcuts

 
Logged in as: Guest
arrSession:exec spGetSession 2,2,632
 Active Users: There are 0 members and 0 guests.
 Users viewing this topic: none
 

 

 
  
  Printable Version
All Forums >> [Scripting] >> WSH & Client Side VBScript >> creating windows shortcuts
  Do you like VisualBasicScript.com? Link to us and help spread the word about our forum. Thanks!
Page: [1]
Login
Message << Older Topic   Newer Topic >>
 creating windows shortcuts - 6/7/2002 10:10:24 AM   
  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."
 
 
Post #: 1
 
 
 
  

If you found our site useful please link to us <a href="http://www.visualbasicscript.com">VisualBasicScript.com</a>.
All Forums >> [Scripting] >> WSH & Client Side VBScript >> creating windows shortcuts Page: [1]
Jump to:





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts