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

Setting Properties for Desktop Shortcut 1

Status
Not open for further replies.

byrne1

Programmer
Aug 7, 2001
415
US
I have a login script that creates a shortcut on a users' desktop. When I set the TARGETPATH property for the shortcut it ends up with double quotes at the beginning and end of the TARGETPATH string. This causes the shortcut not to function.

How can I get rid of the double quotes?

I have copied the code below.


Set objShell = WScript.CreateObject("WScript.Shell")
strDesktopFolder = objshell.SpecialFolders("Desktop")
set objShortCut = objshell.CreateShortcut(strDesktopFolder & "\BROMBERGS.lnk")
objShortCut.TargetPath = "\\dbserver\appwin\ASCMenu.exe C:Brombergs"
objShortCut.Description = "Brombergs ACS System"
objShortCut.Save
 
Replace this:
objShortCut.TargetPath = "\\dbserver\appwin\ASCMenu.exe C:Brombergs"
By this:
objShortCut.TargetPath = "\\dbserver\appwin\ASCMenu.exe"
objShortCut.Arguments = "C:Brombergs"


Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Yahhhhooooooooooooo!

Thank you for the fix!
 
I came across the same advice, didn't I, PHV?
- tsuji
 
I came across the same advice, didn't I, PHV?
Yes, here:
It's a common misuse of the TargetPath property:

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
PHV,

I meant I gave the same advice to this op in the misfortuned thread just a couple number backward, and this op just sat back and relax.

- tsuji
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top