When to quote paths - when not to?

Got a problem you cannot solve? Try here.
Post Reply
JeffTucker
Posts: 62
Joined: Thu Mar 19, 2009 11:07 am
Contact:

When to quote paths - when not to?

Post by JeffTucker »

This is sort of general question. I have observed that Find all files is quite happy looking for a file on a path with enclosed spaces - unquoted.
For example,
Find All Files in path $TARGETDIR$\\ConnectMonitor\\bin\\user.config, write result into variable resultsSearchUserConfig
TARGETDIR is the typical \\Program Files\\... path

But Run program is fussy about the path being quoted.
Run Program wusa.exe "$NET3SP2_BOOTPATH$\\new3sp2bin\\Vista\\NetFX3.0..." /quiet /norestart (WAIT)
But File bag extract paths seem to work fine with Run Program without being quoted.
Run Program $SQLEXPR_FILEBAG$\\sqlexpr.exe /qb ...
Fiddling with technology
MichaelNesmith
Posts: 3452
Joined: Thu Dec 22, 2005 7:17 pm
Contact:

Post by MichaelNesmith »

The only reason you need to quote command line parameters is to ensure they are passed as part of the same parameter.

Ex:

C:\\Program Files

is actually 2 parameters, "C:\\Program" and "Files"

Whereas:

"C:\\Program Files"

is just one parameter because the entire thing is quoted.
Michael Nesmith
Install[b]Aware[/b]
[i]Home of The Next Generation MSI Installer[/i]
Get your free copy today - http://www.installaware.com/
Post Reply