Please enable JavaScript to view this site.

 

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 /W /X] "command ..."

 

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:

 

/=Display the WATCH command dialog to help you set the command line options. The /= option can be anywhere on the line; additional options will set the appropriate fields in the command dialog.

 

/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. You can optionally specify the time in milliseconds by appending an "ms" to the time value.

 

/MnMaximum number of times to run the command

 

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

 

/QnTimeout WATCH after n seconds. The timeout is checked before each run; it will not interrupt the app while it is executing.

 

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

 

/WTruncate output lines at the right column instead of wrapping them to the next line.

 

/XExits if the output changes

 

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