Purpose: | Wait for an app to exit, or optionally for the app to finish processing its initial input and wait for user input. |
Format: | WAITFOR [/Exit=n /Idle=n] [PID | "title" | exename] |
/Exit (ms to wait)
/Idle (ms to wait)
/PID (process ID)
title (window title)
exename
Usage:
You can choose the process by either passing the process ID, the window title, or the executable name.
The process ID can be either hex or decimal; if it is hex you must prefix it with 0x.
The window title must be enclosed in double quotes; wildcards are supported.
Few apps will require the /Idle option.
Example:
Options:
/Exit - Wait for a maximum of n milliseconds for the process to exit. n will default to 10000ms (10 seconds).
/Idle - Wait for a maximum of n milliseconds for the process to enter the idle state. n will default to 10000ms (10 seconds).