General discussion


Show alert on chkdsk fail

By chusome ·
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?

This conversation is currently closed to new comments.

Thread display: Collapse - | Expand +

All Comments

Collapse -

by TonytheTiger In reply to Show alert on chkdsk fail

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.

Collapse -

in that case

by rjsoderlund In reply to

If that's the case, try

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

Related Discussions

Related Forums