Win32 API like CreateProcess, but works on bat/cmd/etc. (i.e. uses PATHEXT)
-
24-06-2021 - |
سؤال
If you use CreateProcess
, it only works on .exe's, apparently. What's the best way to make this work with other executable file types?
The best we have so far is to prepend cmd /c
to such cases. Is that really the correct approach?
المحلول
Batch files aren't technically executable files, they are just registered to open with cmd
. As you mention that you need the ability to manipulate I/O handles, your best bet is indeed to use CreateProcess
with cmd /c
.
لا تنتمي إلى StackOverflow