https://bugs.winehq.org/show_bug.cgi?id=39932
--- Comment #3 from andrej.skvortzov@gmail.com --- Sebastian, I agree with you about complexity of cmd.exe code and kernel32/process is not the perfect place to fix this bug. But I decided to fix the issue in kernel32/process, because original cmd.exe (from Windows) can't run command line like this:
cmd.exe /c "test.bat" param1 "param2" "param3".
It fails with an error: "test.bat" param1 "param2" "param3" is not recognized as an internal or external command If we want to duplicate all functionality of cmd.exe, we need to repeat error cases too. Therefore I decided to remove quotes before cmd.exe is executed, i.e. in kernel32/process.
Code in cmd.exe that removes quotes is written to handle option /S:
/S Strip " quote characters from command. If command starts with a quote, the first and last quote chars in command will be removed, whether /s is specified or not.