Passing double quotes to DOS

Пётр Б. satnatantas@gmail.com
Sun May 3 20:06:00 GMT 2015


https://cygwin.com/ml/cygwin/2002-02/msg00336.html


There was a statement saying that cygwin does everything to preserve double
quotes.

It does not. I was recently doing some symbolic links with "cmd /c mklink
"path" "filename" " recently and it was fine until I had a file with
ampersand.

If I type
cmd /c mklink "path" "filename"

cmd.exe is called without doubleqoutes (I use ProcExp to see cmd line).

If I type same thing in "Run" dialog of TaskManager, doublequotes are
passed as intended.


If I type
cmd /c mklink \"path\" \"filename\"

reverse slash spills to cmd line.

If I type
cmd /c mklink "\"path\"" "\"filename\""

reverse slash and all doubleqoutes spill to cmd line.


I really do not get it. How do I pass doubleqoutes to CMD? Problem is
not related to mklink or any internals of CMD and even bash - Cygwin
does not pass doubleqoutes instead.

Example:
echo "\"bbb\""
cmd /c echo "\"bbb\""

There must be an error somewhere on the CYGWIN/Windows boundary.

Can I somehow whitelist "cmd.exe" so it does not get special treatment?

CYGWIN_NT-6.1 USER 1.7.33-2(0.280/5/3) 2014-11-13 15:47 x86_64 Cygwin

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple



More information about the Cygwin mailing list