Closed j3rem1e closed 5 months ago
@j3rem1e,
Quote handling on Windows has a lot of edge cases, and it looks like the way cmd /c
wants to handle subsequent arguments is tripping up NuProcess's quoting helper. I won't lie; trying to change the logic in WindowsCreateProcessEscape
makes me nervous, because it doesn't have good test coverage and it's so easy to regress handling for other edge cases.
With that said, is there a reason you need cmd /c
? new NuProcessBuilder(Arrays.asList("C:\\Program Files\\MyApp\\start.bat", "another args with spaces"))
should be able to run your batch file without it. Have you tried it that way to see if it works?
Ok thanks, you're right, it works without the "cmd.exe /c" 😄 I'm not a windows export, and I used to use cmd.exe to launch bat files. I didn't know that createprocess accepts bat file.
I'm trying to launch a .bat in windows in a folder containing spaces.
What I want to start is a command like :
However, nuprocess seems to quote the double quote inside the 3rd args and my command fails. Is it possible to launch such command line or what I am doing wrong ?