PFPOSTPRINT issue - follow-up

Kenneth Brody kenbrody at spamcop.net
Tue Dec 18 08:45:19 PST 2012


On 12/18/2012 10:41 AM, Steve Wiltsie wrote:
> Follow up to my own e-mail - that is probably bad form.  fPTech has
> determined there is an issue with PFPOSTPRINT in .02 locating files that
> have a space in the path (ex: PFPOSTPRINT="c:\program
> files\printwiz40\etc.")  The temp fix is to use the old form = progra~1
> without any quotes.  Just thought it would be good to post the current
> status.
[...]

The problem, actually, was a change in filePro that now causes it to run 
into what I might call a "poor design decision" in the Windows command 
processor.

The difference is that this works:

     cmd /c "c:\program files\something\foo.exe" c:\temp\output.txt

whereas this does not:

     cmd /c "c:\program files\something\foo.exe" "c:\temp\output.txt"

See the difference?  It's the quotes around the filename that's passed to 
the program.  (These quotes are necessary if the filename includes spaces. 
For example, "c:\users\bob smith\temp\output.txt".)

Why does this make a difference?  Because "cmd /c" will only handle the 
quotes around the program name as we would expect only if there are "exactly 
two quote characters" on the command line.  In fact, it is documented as:

> If all of the following conditions are met, then quote characters
> on the command line are preserved:
>
> - no /S switch
> - exactly two quote characters
> - no special characters between the two quote characters,
>   where special is one of: &<>()@^|
> - there are one or more whitespace characters between the
>   two quote characters
> - the string between the two quote characters is the name
>   of an executable file.

Note the 4th condition as well.  This is why you can't have quotes around 
the command which uses "progra~1" rather than "program files", for example.

This works:

     cmd /c c:\progra~1\something\foo.exe c:\temp\output.txt

whereas this does not:

     cmd /c "c:\progra~1\something\foo.exe" c:\temp\output.txt


There are currently two workarounds that I have come up with:

1 - As stated above, use the 8.3 name, without quotes.

2 - Add a second quote at the beginning (but *not* at the end) of the 
command.  For example:

     set pfpostprint=""c:\program files\something\foo.exe"

(That way, when the initial quote is stripped as noted above, the remaining 
quote will work as expected.)

-- 
Kenneth Brody


More information about the Filepro-list mailing list