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

Create desktop shortcut in quotes with parameter without 1

Status
Not open for further replies.

meastaugh1

Technical User
Apr 21, 2002
316
Hi,

I have the following in my logon script:
Set WshShell = CreateObject("WScript.Shell")
strDesktopPath = WshShell.SpecialFolders("Desktop")
Set objShortcutLnk = WshShell.CreateShortcut(strDesktopPath & "\Shortcutname.lnk")
objShortcutLnk.TargetPath =chr(34)&"c:\program files\internet explorer\iexplore.exe" & chr(34) & " objShortcutLnk.Save

I would expect the target to be:
"c:\program files\internet explorer\iexplore.exe"
Instead, I get:
"c:\"c:\program files\internet explorer\iexplore.exe"
Any ideas what this is about?

Thanks
 
Hi,

I Believe it's because of the way windows handles the shortcuts. If your default program is IE to open web pages then the only thing you should need to put in the shortcut line is:

objShortcutLnk.TargetPath = "
Once created, it will be automatically assigned IE as the program to open it with. (Unless another program is the default, then that one may be set to open it).

Rgds
Woolsdog

Keyboard Not Detected.....
Press F1 to Continue.
:}
 
Hi,

Yes I am using that as a workaround, but if a user already has a browser open, this shortcut will open the page in the browser that's already open, instead of launching a new instance, which I don't really want. Is there any way around this? Thanks
 
You may try this:
objShortcutLnk.TargetPath = "c:\program files\internet explorer\iexplore.exe"
objShortcutLnk.Arguments = "

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top