PFPOSTPRINT issue - follow-up

Kenneth Brody kenbrody at spamcop.net
Tue Dec 18 10:28:08 PST 2012


On 12/18/2012 1:01 PM, Bob Rasmussen wrote:
> Ken,
>
> Here may be another approach, based on my experience with similar
> requirements; that is, to run an arbitrary user-supplied command with
> parameters. My approach: use CMD only if the user "program" is a ".BAT".
> If the user specifies an EXE, just run it directly.

Actually, filePro already has some logic to do just that.  However, it 
appears that it may need to be updated, so that this situation would be avoided.

>
> On Tue, 18 Dec 2012, Kenneth Brody wrote:
>
>> 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