Page 1 of 1

When to quote paths - when not to?

Posted: Tue May 12, 2009 6:37 pm
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 ...

Posted: Tue May 12, 2009 9:44 pm
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.