Use a windows command to list file sizes
Hi, I am looking for a Windows command or tool to list file sizes larger than a specified size. I thought FORFILES could help me, but I am not sure it can do the job. Example problem: A folder with a large number of subfolders and files, and an easy way to find the largest files searching all subdirectories, and listing up those files taking up much space. Freddy
December 27th, 2011 7:06am

Post if this solve you problem! Hello Cesar, You can use "Dir /S", with this parameter you can search all files in Subfolders... complementing, you can add "Sortorder S" to filter by size of the file. Follow the example; Cd /d %Windir% Dir /S *Framework sortorder S Basically, I went into the directory C: \ Windows and search all files with "frame" in its name, filtering by size.
Free Windows Admin Tool Kit Click here and download it now
December 27th, 2011 8:23am

Not exactly what I was looking for unfortunately. I need the list of the directories and files with the filesize on the largest files, lets say 100 MB as an example of the search criteria I tried the following command: forfiles /p c:\test /s /m *.* /c "cmd /c if @fsize>>100000 echo @fsize is a file of 100 MBs" Gives me an error >> was unexpected at this time. Can I modify this command and use it?Freddy
December 27th, 2011 8:58am

Hi, Just try following command. I have tested it on my side. forfiles /p d:\new /s /m *.* /c "cmd /c if @fsize gtr 100000 echo @file" Hope that helpsWilliam Tan TechNet Community Support
Free Windows Admin Tool Kit Click here and download it now
December 29th, 2011 4:57am

Hi, Just try following command. I have tested it on my side. forfiles /p d:\new /s /m *.* /c "cmd /c if @fsize gtr 100000 echo @file" Hope that helpsWilliam Tan TechNet Community Support
December 29th, 2011 12:53pm

Works perfectly! Thank youFreddy
Free Windows Admin Tool Kit Click here and download it now
January 2nd, 2012 9:09am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics