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

Shortcuts with a switch 1

Status
Not open for further replies.

JSOasis

Programmer
Sep 26, 2006
8
US
Hi I am trying to make a shortcut that has a switch. I need the first part of the shortcut to be in " and the last part not in " i.e.:


"C:\Program Files\MyApp\app.exe" C:\Program Files\MyApp\appini.ini


Here is what I have:


Dim desktopPath
Dim Shortcut

Set createShell = CreateObject("Wscript.Shell")
desktopPath = createShell.SpecialFolders("Desktop")

Set Shortcut = createShell.CreateShortcut(desktopPath & "\" & "My App" & ".lnk")
Shortcut.TargetPath = "C:\Program Files\MyApp\app.exe" & "C:\Program Files\MyApp\appini.ini"
Shortcut.Save


I need the C:\Program Files\MyApp\appini.ini outside the ""

 
You have to use the Arguments property of the WshShortcut Object:
Shortcut.TargetPath = """C:\Program Files\MyApp\app.exe"""
Shortcut.Arguments = """C:\Program Files\MyApp\appini.ini"""

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top