Check secondary Hard Drives silently

Various changes to the Windows Operating System, also for the Intranet

Moderator: sjj1805

Post Reply
User avatar
sjj1805
Site Admin
Posts: 1194
Joined: Fri Oct 27, 2006 12:45 am
operating_system: Windows 10 Pro
motherboard: Hewlett Packard 2AF7
system_drive: C
32bit or 64bit: 64 Bit
processor: 2-90 gigahertz Intel Core i5 4460S
ram: 8 GB
video card: NVIDIA GeForce GT 705
sound card: P40D100-4 NVIDIA High Definition Audio
Hard_Drive_Capacity: 8 TB
Location: Birmingham UK
Contact:

Check secondary Hard Drives silently

Post by sjj1805 » Mon Aug 01, 2022 8:49 am

Copy the following into Windows Notepad and give it a "BAT" extension, then run as an Administrator
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:

Post Reply