PFPOSTPRINT issue - follow-up
Bob Rasmussen
ras at anzio.com
Tue Dec 18 10:01:06 PST 2012
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.
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
> _______________________________________________
> Filepro-list mailing list
> Filepro-list at lists.celestial.com
> Subscribe/Unsubscribe/Subscription Changes
> http://mailman.celestial.com/mailman/listinfo/filepro-list
>
>
Regards,
....Bob Rasmussen, President, Rasmussen Software, Inc.
personal e-mail: ras at anzio.com
company e-mail: rsi at anzio.com
voice: (US) 503-624-0360 (9:00-6:00 Pacific Time)
fax: (US) 503-624-0760
web: http://www.anzio.com
street address: Rasmussen Software, Inc.
10240 SW Nimbus, Suite L9
Portland, OR 97223 USA
More information about the Filepro-list
mailing list