I am spawning a child console process (zip.exe) from an MFC application
static TCHAR s_atchZipTool[] = _T("\\tools\\zip.exe");
sArgZip.Format(_T("%s%s -e -r %s *.*"), GetAppPath(), s_atchZipTool, sFilePathName);
if( !CreateProcess(NULL, (LPTSTR)(LPCTSTR) sArgZip, NULL, NULL,
FALSE, CREATE_NO_WINDOW, NULL, sFilesPath, &si, &pi) )
{
return ::GetLastError();
}
else
{
::WaitForSingleObject( pi.hProcess, INFINITE );
}
CloseHandle(pi.hProcess);
CloseHandle(pi.hThread);
So when I do not need to set password for zipped file everything is fine, but how can I send multiple messages as console input to this process? Parameter -e forces me to put 2 more strings "Enter password", "Verify password".