Link to home
Start Free TrialLog in
Avatar of ITApprendista
ITApprendista

asked on

Use Chkdsk Exit Code to generate Alert

Hello

I am looking to write a script - (vbscript or batch file or combo of both) to run chkdsk on all fixed disks on a given system (mostly servers) in read only mode.  If chkdsk encounters problems it would use the chkdsk exit codes or info in the chkdsk log to write alert us somehow that we should run a chkdsk /r

I believe I know how to do the actual alerting piece.  But how to pull the info from a chkdsk log or read the chkdsk exit codes is where I'm unsure
Avatar of Cameron_S
Cameron_S
Flag of United States of America image

You could write the script so the output of the chkdsk is put to a flat file (text file), then just have your script parse the flat file for the results and take action from there.
ASKER CERTIFIED SOLUTION
Avatar of Mike Tomlinson
Mike Tomlinson
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial