Purpose:Monitor free disk space

 

Format:DISKMONITOR [/C [disk]]

DISKMONITOR disk size command

 

diskDisk drive to monitor
sizeMinimum free disk space
commandCommand to execute when condition is triggered

 

/C(lear)

 

Usage:

 

If the free disk space for the drive drops below the specified size, DISKMONITOR will execute the specified command. For example, to send an email when the C: drive has less than 2Gb free:

 

DISKMONITOR C: 2Gb sendmail bob@bob.com "Disk Status" Drive C: is full!

 

The drive can also be a sharename. The size format is the same as that used for size ranges (i.e., either a number or a number with an appended k, K, m, M, g, G, t, or T).

 

The command line will be parsed and expanded before DISKMONITOR is executed, so if you want to pass redirection characters or variables to command you will need to protect them (by enclosing in single back quotes, doubling the %'s, or using command grouping).

 

If the last argument on the line is a single (, it is interpreted as the beginning of a command group. DISKMONITOR will append the following lines (in a batch file) or prompt you for more input (at the command line) until it gets a closing ).

 

If you don't enter any arguments, DISKMONITOR will display the disk drives it is currently monitoring.

 

DISKMONITOR will poll the drives it is monitoring once every 10 seconds.

 

Options:

 

/CIf disk is specified, remove the monitor for that disk drive. Otherwise, remove all disk monitors.