Purpose:Run command(s) repeatedly, displaying the output and highlighting the difference(s) from the last run.

 

Format:WATCH [/A /B /C /D /F /Hn /In /Mn /Nf /Nh /R"regex" /Tn /U /V /X] "command ..."

 

/A highlight all changes/M maximum count
/B beep if return != 0/N[fh] no footer/header
/C clear screen/R regex
/D disable colorization/T footer lines
/F prompt on change/U beep if output changed
/H header lines/V verbose
/I interval/X exit if output changed

Usage:

 

WATCH allows you to see how program output changes over time. WATCH will highlight the changed output text. To end the WATCH, press Esc or ^C.

 

Command can be an internal command, alias, batch file, or an external application.

 

Note that you need to double your variable %'s if you want the variables to be expanded by the specified commands instead of by WATCH.

 

Example:

 

watch /c /v "(echo time=%%_time & echo date=%%_date)"

 

Options:

 

/AHighlights all changes between the current run and the first one,instead of the difference between the current and previous runs.

 

/BBeeps if the return code != 0

 

/CClear the display and home the cursor before each run

 

/DDisable the highlight colorization

 

/FFreezes the display if the output changed, and prompts you to enter a key to continue.

 

/HnDisplay only the leading n lines

 

/InInterval (in seconds) between each run

 

/MnMaximum number of times to run the command

 

/N[fh]Don't display the WATCH footer and/or footer

 

/R"regex"Only display the output line(s) that match the regular expression

 

/TnDisplay only the trailing n lines

 

/UBeep if the output changes

 

/VVerbose output (header and footer)

 

/XExits if the output changes

 

"command..."Command(s) to execute