Use CreateProcess to Run a Batch File
Some problems: You need to pass the /C option to cmd.exe in order to make it execute the .bat file. The second parameter to CreateProcess must be a modifiable string. Not a literal. You need to escape backslash characters in literals. lpszCurrentVariable points to the buffer returned by GetEnvironmentStrings. You cannot modify that buffer. You … Read more