GZProMon |
A command line process monitor for Windows |
PurposeGZProMon is a command line process monitor for Windows. Its job is to examine the Windows running processes list to see whether a given executable is running. If it is, GZProMon can sleep for a configurable interval and check again. This polling process can be repeated a configurable number of times before GZProMon exits. The primary use for GZProMon is in an ACM task list where some process has been spawned off asynchronously (using the trailing & on the parameters). If the task list must then wait until this process completes, then it can use GZProMon at the end of the task list to do so. Command FormatThe line command is of the following generic form: gzpromon process-list <options>where process-list options is a set of zero or more options or switches. Each option is preceded by a slash (/) or dash (-). The order of options is unimportant. The command will complete when all the processes in the process list have been found to be not running or the timeout limit has been reached. In the former case, GZProMon will exit with a completion code of zero (0). In the latter, it will exit with code one (1). Note that the /run option inverts the completion logic so that a zero return code indicates all processes are still running. OptionsThis is the list of options which may appear on the command line after the process list. Options may have parameters. If so, an equal sign separates the option from its parameters. No spaces can appear around the equal sign.
Exit CodesGZProMon exits with zero when the monitoring condition is met, i.e. when all processes are not running (by default) or when all processes are running if the /run option is used. If the condition is not met, it exits with code of one. ExampleConsider this command: gzpromon myapp1.exe,myapp2.exe /initwait=30 /nextwait=10 /retries=5 This will wait for two programs, MYAPP1 and MYAPP2, to complete. No check of the process list will be done for 30 seconds. GZProMon will pause for 10 seconds between each check. There will be five retries or a total of 6 checks before exiting with exit code one. The maximum length of time allowed by this command for these two programs to finish is 80 seconds (5x10 + 30). Sample OutputIf the above example command were issued, GZProMon might return messages like those below. (In an ACM task list, this output can only be seen by redirecting stdout.) |
G&Z Process Monitor - Ver. 1.01 - 09/14/01 07:30 Sleeping for initial wait of 30 seconds... Reading Windows process list... Found target process: myapp1.exe Found target process: myapp2.exe Processes scanned: 151; found 2; not found 0 Sleeping for next wait interval of 10 seconds... Reading Windows process list... Found target process: myapp1.exe Processes scanned: 151; found 1; not found 1 Sleeping for next wait interval of 10 seconds... Reading Windows process list... Processes scanned: 151; found 0; not found 2 Process monitoring complete; exit code is 0 |
Note that by using the /quiet option, none of the above would appear.
No HOME button on the left side of your page?
Click here for Our Home Page