Discussion Locked

Show alert on chkdsk fail

0 helpful
2 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

I'd like to setup our windows clients with a scheduled monthly chkdsk which I will use the task manager for. However I would also like it to display an alert if chkdsk finds bad sectors.

I've looked at physical disk alerts and they only contain read/write timing.

Anyone know how this can be done?

2 replies

by tonythetiger

You can run chkdsk in a batchfile and test for errorlevel.

chkdsk c: /f
if errorlevel 1 goto :alert

I don't know what the errorlevel is for 'bad sectors' but I assume anything except zero probably warrants attention.

by rjsoderlund

If that's the case, try

@echo off
chkdsk c: /f
if not errorlevel 0 goto alert
:ok
echo Your drive is ok
goto end
:alert
echo There is reason to believe a problem exists.
pause
goto end
:end

This discussion is closed to new replies.