[TIP] Command-line check for disk errors

Metanis

Well-Known Member
Reaction score
810
Location
Medford, WI, USA
Figured it was time to dust off the scripting cobwebs by attempting to reverse engineer reddit/tronscript.

But almost immediately I thought it would be good to check the main drive for errors before running some exhaustive script. Obviously the presence of a lot of disk errors would probably have me perform a cloning process before continuing...

Start an admin-level command prompt before beginning any clean-up or automation and type this to quickly get a dump of reported disk errors as reported by every version of Windows since Vista:

powershell get-winevent -ProviderName disk,Disk

(Yes, you can open the event viewer and do this with filters too, but on a typical infected/slow consumer machine the CMD prompt can be much quicker!)
 
Back
Top