Created
September 5, 2017 09:47
-
-
Save olegchir/f5ea7481eaf19bc721fbdb2ba0131227 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
STARTUPINFO si; | |
ZeroMemory( &si, sizeof(si) ); | |
si.cb = sizeof(si); | |
PROCESS_INFORMATION pi; | |
ZeroMemory( &pi, sizeof(pi) ); | |
// Spawn creates a cmd.exe window. CreateProcess doesn't. | |
//if ( _spawnl( _P_WAIT, szFileNameBAT, szFileNameBAT, NULL ) ) { | |
if ( !CreateProcess( szFileNameBAT, szFileNameBAT, NULL, NULL, false, | |
CREATE_NO_WINDOW, NULL, NULL, &si, &pi ) ) { | |
MyErrorFunc( "CreateProcess( \"%s\" ): %d", szFileNameBAT, GetLastError() ); | |
goto MyErrorHandling; | |
} | |
WaitForSingleObject( pi.hProcess, INFINITE ); | |
CloseHandle( pi.hProcess ); | |
CloseHandle( pi.hThread ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment