Desktop shortcut logon script space in string

Posted on 2007-10-18
Last Modified: 2013-12-04
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
Question by:kleyba
    LVL 18

    Expert Comment

    by:Andrew Davis
    why not just create a working shortcut, then in the logon script have it copy that shortcut to the desktop?
    LVL 5

    Accepted Solution

    Use the 'Arguments' property (see


    Shortcut.TargetPath = "P:\IDPMS.exe"
    Shortcut.Arguments = "CAR"

    Author Comment

    Thank you so much...  spend way to much time trying to figure this out...

    Featured Post

    How to run any project with ease

    Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
    - Combine task lists, docs, spreadsheets, and chat in one
    - View and edit from mobile/offline
    - Cut down on emails

    Join & Write a Comment

    A theme is a collection of property settings that allow you to define the look of pages and controls, and then apply the look consistently across pages in an application. Themes can be made up of a set of elements: skins, style sheets, images, and o…
    Entering time in Microsoft Access can be difficult. An input mask often bothers users more than helping them and won't catch all typing errors. This article shows how to create a textbox for 24-hour time input with full validation politely catching …
    This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA.…
    Sending a Secure fax is easy with eFax Corporate ( First, Just open a new email message.  In the To field, type your recipient's fax number You can even send a secure international fax — just include t…

    728 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    20 Experts available now in Live!

    Get 1:1 Help Now