Files
CMake/Tests/RunCMake/execute_process/WindowsBatch-stdout.txt
Brad King 74c9d40876 execute_process: Fix invocation of .cmd/.bat with spaces
The `CreateProcessW` documentation states "to run a batch file, you must
start the command interpreter".  Use `cmd /c the.bat` to run batch files.
Also, use a "short path" to the `.bat` file if needed to avoid spaces.

Previously this worked in some cases only due to undocumented behavior
of `CreateProcessW` when given a `.bat` file.

Fixes: #26655
2025-02-03 09:13:26 -05:00

9 lines
210 B
Plaintext

^bat arg1 - arg2 -
bat "arg1 space" - arg2 -
bat arg1 - "arg2 space" -
bat "arg1 space" - "arg2 space" -
cmd arg1 - arg2 -
cmd "arg1 space" - arg2 -
cmd arg1 - "arg2 space" -
cmd "arg1 space" - "arg2 space" -$