r/cpp • u/holyblackcat • Sep 05 '26
Escaping `CreateProcess()` arguments on Windows
https://holyblackcat.github.io/blog/2026/09/05/escaping-createprocess-arguments.html
93
Upvotes
r/cpp • u/holyblackcat • Sep 05 '26
View all comments
Show parent comment
7
u/holyblackcat Sep 05 '26
:P Is it wrong though. Everything else being equal, isn't it better to use the version that doesn't depend on defines to work? Header-only libraries in particular would benefit from this.
If you have the full path, why not pass it in
lpCommandLine? Then you don't have to worry about syncing the first element inlpCommandLinewithlpApplicationName.