Javascript must be enabled to download our products and perform other essential functions on the website.

ionicons-v5-m
ionicons-v5-j
Buy Now Download Free Trial
ionicons-v5-m
ionicons-v5-f

Command Line Options in PA WatchDISK

WatchDISK has the ability to run in an automated fashion using command line arguments. The automated alerts take advantage of this feature when they schedule a WatchDISK run via the Microsoft Task Manager. The following arguments can be passed to WatchDISK on the command line:

/DIR=scandir
Set scandir to the directory you want to use. The /DIR option can also be used by itself to command WatchDISK to come up with the specified default directory. If there are spaces in the directory name, enclose the directory in quotes, as in /DIR="C:\Program Files" NOTE: None of the other options work unless a directory has been set using the /DIR= parameter

/SAVE
This option causes the scan to be saved when done

/SAVESUBDIRS
This option causes the scan to save data for all subdirectories scanned

/SCAN
This option causes a scan to happen

/PRINT={LPT1|FILE=filename}
This option causes a disk space report to be printed to the default printer (not necessarily on LPT1--that is just the command name), or to a file. The format is controlled by the optional /PRINTFORMAT command, or by the last values used in the Export dialog.

/PRINTFORMAT={BYTES|K|MB|GB|SMART},{UNITS|NOUNITS},{TEXT|HTML|CSV},{NUMCOLUMNS},{NUMROWS},{REVCOLS|NOREVCOLS},{TOTALS|NOTOTALS}
If the /PRINTFORMAT option exists, the numbers are shown in bytes, K, MB, GB or Smart, Units are shown or not, the output is in Text, HTML or CSV format, the number of columns (from the last scan) and the number of rows indicated are shown, and whether columns are reversed for outputting. These values work the same way as in the Export dialog. Missing values (or if the whole /PRINTFORMAT command is missing) are taken from the last values used in the Export dialog.

/DEBUG=dump.txt
Causes diagnostic output to be written to the file dump.txt. Use this option if you should ever need to send Power Admin Support feedback about a problem you're having.

/ALERTPERCENT=number
You will be alerted if the size of any directory under the directory specified by /DIR= has grown by number% between the last two scans stored in the database. You should have /SCAN on the command line such that new data is being compared. numbershould be an integer greater than 0.

/ALERTPERCENT=number
You will be alerted if the size of any directory under the directory specified by /DIR= has grown by number% between the last two scans stored in the database. You should have /SCAN on the command line such that new data is being compared. numbershould be an integer greater than 0.

/ALERTSIZE=number
You will be alerted if the size of any directory under the directory specified by /DIR= has grown by numberK bytes (1024 bytes) since the last scan. You should also use the /SCAN option so you're checking current data. numbershould be an integer greater than 0. Remember, number is the size in K that you are comparing against.

/FREEALERT=number
WatchDISK will check the drive/directory specified by /DIR= and alert you if the available free space on the drive drops below number K bytes (1024 bytes).

/FREEPERCENT=number
WatchDISK will check the drive/directory specified by /DIR= and alert you if the drive's percentage of free space has dropped below the number percentage given. Number must be an integer between 1 and 100. NOTE: When an alert condition occurs, one of the command line options below can be used to provide the notification

/MAXSIZE = number
number is the maximum number of K bytes (1024 bytes) that the directory can be. If the directory size is over MAXSIZE, then the alerts fire.

/MSGBOX
This option will have WatchDISK pop-up a message box to alert you about disk space changes.

/PID=list of IDs
Each notification profile has an ID number associated with it (it is displayed by the PID= in the Alert dialog). You can specify that you want to be alerted by one or more of those notification profiles. Simply put the ID of the profile you choose. If you'd like more than one profile used, separate them by commas (don't put spaces in the specification). Example: /PID=2,13,25

/NOTIFY=command line
The program specified after /NOTIFY= will be run passing the rest of the command line to it. IMPORTANT: /NOTIFY must be the very last command on the command line. If you want your custom program to know the directory, the size or a message from WatchDISK to be used, you can put the following strings on the command line and the proper values will be substituted before calling your program: $DIR$ - Turns into whatever was passed in the /DIR= command $SIZE$ - The current size of the directory $MSG$ - The message string that would have shown up in the Message Box. The substitutions do NOT take quotes into consideration. In other words, ALL occurances of the keywords above will be substituted.

Examples

This line will notify users via profile ID 1, 2 and 5

WATCHDSK.EXE /DIR=C:\ /FREEALERT=200000 /PID=1,2,5

The example below will broadcast a message to the Administrator user (on a Windows NT network) any time \\SERVER\USERS free space drops below 1 GB:

WATCHDSK.EXE /DIR=\\SERVER\USERS /FREEALERT=1000000 /NOTIFY=C:\WINNT\SYSTEM32\NET.EXE SEND 
/MISDOMAIN:Administrators "Disk Space on $DIR$ has dropped to $SIZE$"

NOTE: SEND.EXE can be used on Novell networks to accomplish the same alerting task as NET.EXE SEND does on Windows networks.


The following line will scan C:\WINDOWS and save the data when done:

WATCHDSK.EXE /DIR=C:\WINDOWS /SAVE /SCAN

The line below will simply print the current data (ie, not do another scan) to D:\DATA\DIRSIZE.TXT for the directory of U:\USERS:

WATCHDSK.EXE /DIR=U:\USERS /PRINT=FILE=D:\DATA\DIRSIZE.TXT

The line below will alert you if the \\SERVER\USERS directory has grown by more than 10 MB

WATCHDSK.EXE /DIR = \\SERVER\USERS /ALERTSIZE=10000 /SCAN

The example below will broadcast a message to the Administrator user (on a Windows NT network) any time \\SERVER\USERS free space drops below 1 GB:

WATCHDSK.EXE /DIR=\\SERVER\USERS /FREEALERT=1000000 /NOTIFY=C:\WINNT\SYSTEM32\NET.EXE SEND 
/MISDOMAIN:Administrators "Disk Space on $DIR$ has dropped to $SIZE$"

Hands down your company is the BEST vendor I have ever worked with in my 41 years working in IT.

Karla P., Northwestern Energy, USA ionicons-v5-b