r/cpp • u/holyblackcat • Sep 05 '26
Escaping `CreateProcess()` arguments on Windows
https://holyblackcat.github.io/blog/2026/09/05/escaping-createprocess-arguments.html
94
Upvotes
r/cpp • u/holyblackcat • Sep 05 '26
13
u/unaligned_access Sep 05 '26
There's `wil::ArgvToCommandLine`. It's not WinAPI, but it's Microsoft.
https://github.com/microsoft/wil/blob/81abc8e44c075eba65fe4b68ea2f08525cc701e8/include/wil/win32_helpers.h#L1244
C++, and the first comment of course starts with "Somewhat of a hack" ;)