According to the
CreateProcess()[
^] function in the MSDN, batch files require special handling:
Quote:
To run a batch file, you must start the command interpreter; set lpApplicationName to cmd.exe and set lpCommandLine to the following arguments: /c plus the name of the batch file.
When using the
lpCommandLine
parameter with the Unicode version, it must be a non const pointer (see the above link).
So you may try this:
wchar_t lpszCmdLine[] = L"/c E:\\TestFolder\\процессов.bat";
if( !CreateProcessW(
L"cmd.exe",
lpszCmdLine,NULL,NULL,
FALSE,
0,NULL,NULL,
&si, &pi )
)