This will check (in this example) 1 Secondary Internal Drive and 4 external USB drives without asking the user to confirm that each drive will be dismounted
The routine checks that each drive is attached to the computer and skips to the next one if it is not.
Code: Select all
if not exist D:\$RECYCLE.BIN goto step3
echo y|chkdsk /f D:
:Step2
if not exist H:\$RECYCLE.BIN goto step3
echo y|chkdsk /f H:
:Step3
if not exist M:\$RECYCLE.BIN goto step4
echo y|chkdsk /f M:
:Step4
if not exist P:\$RECYCLE.BIN goto step5
echo y|chkdsk /f P:
:Step5
if not exist V:\$RECYCLE.BIN goto step6
echo y|chkdsk /f V:
:Step6
End: