I tried to execute a batch file which is in same directory as in the application is and hide the batch file window as in hidden but the code doesn't work for some reason.
Please help me what is wrong in the code. Below is the code.
STARTUPINFO StartupInfo;
PROCESS_INFORMATION ProcessInfo;
memset(&StartupInfo, 0, sizeof(StartupInfo));
StartupInfo.cb = sizeof(STARTUPINFO);
StartupInfo.dwFlags = STARTF_USESHOWWINDOW;
StartupInfo.wShowWindow = SW_HIDE;
CreateProcess(NULL, _T("Testfile.bat"), NULL, NULL, FALSE,CREATE_NEW_CONSOLE, NULL, NULL,&StartupInfo,&ProcessInfo);
The application crashes when the control comes to this portion of the code.