Problem Escaping Backslashes and Quotes in CFEXECUTE
I'm having trouble getting CFEXECUTE to properly pass arguments through to the command line.
Specifically, when passed \" (literal quote) the command line sees \\" (literal backslash, quote) instead.
This only happens for the FIRST instance of a backslash.
If I set up a variable called theArgumentsString, for example, by doing the following:
<CFSET theArgumentsString = "-a -b ""c \""d\"" ""e""">
The string variable itself is fine. I get the following (expected) as the value of theArgumentsString:
-a -b "c \"d\" "e"
However, the command that runs does not get the same arguments.
It gets:
-a -b "c \\"d\" "e"
There is an extra backslash added in front of the first backslash.
I've tried passing in an array of arguments instead of a string, and the same thing happens.
I have no idea which end (CF or Windows) is causing the problem.
It only happens on the very first backslash present.
For example, if I pass in the arguments:
\"\"\"\"
What gets passed run on the command line is:
\\"\"\"\"
Running the command manually (with the proper arguments) from the command prompt works fine.
Running it from a batch file works fine, too.
Only when running from CFEXECUTE does the extra \ get added.
We're running...
| Server Product | ColdFusion |
| Version | 9,0,1,274733 |
| Edition | Standard |
| Operating System | Windows Server 2008 R2 |
| OS Version | 6.1 |
| Adobe Driver Version | 4.0 (Build 0005) |
Any ideas? And can anyone reproduce this (on other OSs/CF builds)?
