Tuesday, July 28, 2015

Sysinternals: DU (Disk Usage) - Reusable Batch File

Every time the drive starts filling up, I have to figure out where the culprit is. I wrote this batch script to save on a mountable share drive and run it whenever I have an issue. The script will scan the C: drive and save a report to the location where the batch file is located.

Click here to download the Sysinternals utility

I recommend opening the report in EXCEL to better sort through the data

:: OPTIONAL LINE to not show commands running
@echo off

:: Change directory to current working directory where batch file is located
@cd %~dp0

:: run disk usage utility in quiet mode against the C: drive and export to file named after computer name
@du -v -q c: > %computername%.txt

:: close the command window
@exit
- JBNX