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 Rhinorhino on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

VBScript shortcut created at login

Status
Not open for further replies.

Slackoff01

IS-IT--Management
Joined
Sep 8, 2010
Messages
2
Location
US
First I am very new to VBS but am looking to put together a login script that will create a link back to my submit request form.

I need for it to force open a new IE browser as many use Firefox here but must use IE to gain access to link.

Thus far I have been able to get it to open new IE and direct to what I am after all while also creating the desktop shortcut I need. The downside is when this new link is used it doesn't properly direct to URL.

*Note when I am getting file to run firs time I am just running script from folder locally

Heres what I put together any input is greatly appreciated!

Set objShell = WScript.CreateObject("WScript.Shell")
strDesktop = objShell.SpecialFolders("Desktop")
Set objShortcut= objShell.CreateShortcut(strDesktop & "\Tech Support.lnk")
Set WshShell = WScript.CreateObject("WScript.Shell")
WshShell.Run "iexplore With objShortcut
.TargetPath = "iexplore.exe .IconLocation = Windir & "%SystemRoot%\system32\SHELL32.dll, 23"
.WorkingDirectory = strDesktop
.Save
End With
 
You need to specify the URL as an argument. Also be careful if you have 64 bit clients. You will want to specify the actual path to Internet Explorer to ensure your link works.

Code:
Set objShell = CreateObject("WScript.Shell")
strDesktop = objShell.SpecialFolders("Desktop")
Set objShortcut= objShell.CreateShortcut(strDesktop & "\Tech Support.lnk")
Set WshShell = WScript.CreateObject("WScript.Shell")

objShortcut.TargetPath = "C:\Program Files\Internet Explorer\iexplore.exe"
objShortcut.Arguments = "[URL unfurl="true"]http://server/folder/folder/Support%20Request/NewForm.aspx"[/URL]
objShortcut.IconLocation = Windir & "%SystemRoot%\system32\SHELL32.dll, 23"
objShortcut.WorkingDirectory = strDesktop
objShortcut.Save

I hope that helps.

Regards,

Mark

Check out my scripting solutions at
Work SMARTER not HARDER. The Spider's Parlor's Admin Script Pack is a collection of Administrative scripts designed to make IT Administration easier! Save time, get more work done, get the Admin Script Pack.
 
Awesome!

Figured I was missing something obvious.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top