• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 369
  • Last Modified:

Desktop shortcut logon script space in string

Can someone please tell me what the problem is.
This script is to put a shorcut on the desktop.
But the targetpath has a space in it...  It's causeing the shortcut result to be invalid.

I tried all of these...
Shortcut.TargetPath = "P:\IDPMS.exe" + " " + "CAR"
Shortcut.TargetPath = "P:\IDPMS.exe" & " " & "CAR"
Shortcut.TargetPath = "P:\IDPMS.exe" +  " CAR"
Shortcut.TargetPath = "P:\IDPMS.exe" & " CAR"
Shortcut.TargetPath = "P:\IDPMS.exe CAR"

The result is "P:\IDPMS.exe CAR" with the quotes!!  I do not want the quotes...
I just want it to say P:\IDPMS.exe CAR

Please help going nuts...

Logon Script
1 Solution
Andrew DavisManagerCommented:
why not just create a working shortcut, then in the logon script have it copy that shortcut to the desktop?
Use the 'Arguments' property (see http://msdn2.microsoft.com/en-us/library/yf7kaky2.aspx).


Shortcut.TargetPath = "P:\IDPMS.exe"
Shortcut.Arguments = "CAR"
kleybaAuthor Commented:
Thank you so much...  spend way to much time trying to figure this out...
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: CompTIA Cloud+

The CompTIA Cloud+ Basic training course will teach you about cloud concepts and models, data storage, networking, and network infrastructure.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now