Syntax for executing shell commands

This commit is contained in:
Krzosa Karol
2024-08-08 11:06:51 +02:00
parent ad2efab7c8
commit 3488c71155
5 changed files with 20 additions and 7 deletions

View File

@@ -367,8 +367,11 @@ Process CreateCommandLineProcess(String command_line, String working_dir) {
String16 cmd = ToString16(scratch, command_line);
void *env = NULL;
DWORD dwCreationFlags = 0;
BOOL bInheritHandles = TRUE;
PROCESS_INFORMATION info = {};
if (!CreateProcessW(L"c:\\windows\\system32\\cmd.exe", cmd.data, 0, 0, TRUE, 0, env, cwd.data, &startup, &info)) {
if (!CreateProcessW(L"c:\\windows\\system32\\cmd.exe", cmd.data, 0, 0, bInheritHandles, dwCreationFlags, env, cwd.data, &startup, &info)) {
Win32ProcessError(&process, "failed to create process", command_line);
return process;
}