We help IT Professionals succeed at work.

DOS  Batch file for Drive space & large files

AndyPandy
AndyPandy asked
on
I searched for this extensively and surprisingly couldn't find.
I need a DOS batch file to run from the command window to provide a quick view of:
Disk Letter
Disk Capacity,
Disk Available
and
Listing  of the Large files (over 10GB) & their path and size, in descending size order.
Output in field width format.
One drive is fine,  but all drives is a bonus.
I would think everyone supporting application on a wide variety of customers and envrionments would need this.
Comment
Watch Question

AmitIT Architect
Distinguished Expert 2017
Commented:
try tree view tool
Commented:
Personally I'd use treesize, free version is fine.... http://www.jam-software.com/freeware/ or of course you can use explorer to do a search.

This function of mine here:

http://scripts.dragon-it.co.uk/links/batch-biggest-files-in-folders

Will find the 20 biggest files under a directory structure in two different ways and could soon be adapted to pull out rather than the top 20, all those over a certain size.

Steve
Commented:
I use diruse from windows resource kit for listing large files

example diruse p:\ /M /S /D /Q:10000

Searching for directories that have exceeded 10000 megabytes
    Size (mb)  Files  Directory
!    21999.39      7  P:\ISO\Adobe\CS5
!    16611.39      7  P:\ISO\ArcGIS
!    14776.80      8  P:\ISO\Microsoft
!    24461.00      8  P:\ISO\Microsoft\Server
!    28669.45     11  P:\ISO\Microsoft\Windows7
!   196223.04  131833  SUB-TOTAL: P:\ISO

!   196223.04  131833  TOTAL: P:\ISO

Test your restores, not your backups...
Expert of the Year 2019
Top Expert 2016
Commented:
It isn't going to be fast, but you should be able to use the WMIC command to locate all files on a disk larger than a specified size, as in:

wmic datafile where "filesize > 2000000" get path

~bp