|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)
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.