

Some excerpts: usage: logit.sh Įxample: logit.sh -p error -i 501 -s myscript. So I created a little Bash script to take care of this. I wanted the messages in WEVL to be custom, have the correct exit code, details, priorities, message, etc. Printf("The exit code for '%ws' is %d\n",(LPTSTR)(strCmd.GetString()), result ) Īt one point I needed to accurately push log events from Cygwin to the Windows Event log. Printf("GetExitCodeProcess() failed (%d)\n", GetLastError() )

If(!GetExitCodeProcess(pi.hProcess,(LPDWORD)&result)) Step 4 During the installation you will be asked to zone your hard drives.

WaitForSingleObject( pi.hProcess, INFINITE ) Step 3 Boot from the media and follow the instructions to install the operating system files. Printf( "Waiting for \"%ws\" to exit.\n", strCmd ) Printf( "CreateProcess failed (%d)\n", GetLastError() ) &pi ) // Pointer to PROCESS_INFORMATION structure (LPTSTR)(strCmd.GetString()), // Command lineįALSE, // Set handle inheritance to FALSE If( !CreateProcess( NULL, // No module name (use command line) Check if it exists and you have the right permissions to open it.' exit (1) check exit code if args.exitcode: logfile f.read () if not re.search ('exit 0', logfile, flagsre.I): print 'CRITICAL: Exit code not found in File s' log exit (2) Check last file modification time if args.time: File Modification time in seconds since epoch. Printf("Arguments passed: '%ws'\n",args) It might not work correctly when using a program that is not attached to the console, because that app might still be running while you think you have the exit code.Ī solution to do it in C++ looks like below: #include "stdafx.h"ĬString args = cmdline.Mid(self.GetLength()+1)
