General discussion

Locked

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.

2 total posts (Page 1 of 1)  
| 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
k
echo Your drive is ok
goto end
:alert
echo There is reason to believe a problem exists.
pause
goto end
:end

Back to Windows Forum
2 total posts (Page 1 of 1)  

Related Discussions

Related Forums