
The above examples were indeed from a Windows 7 computer. Though the tool is intended for XP and Server 2003, I have observed that it works on Windows 7 also. To get the directory size in mega bytes we can add /M switch. diruse.exe directory_nameĪs you can see in the above example, diruse prints the directory size in bytes and it also prints the number of files in the directory(it counts the number of files in the sub folders also) This command can be used to get directory size. But there is a tool called diruse.exe which can be used to get folder size.


There’s no Windows built in command to find directory size. Save the above commands to a text file, say filesize.bat, and run it from command prompt. offįor /F "tokens=4,5" %%a in ('dir c:\windows\fonts') do echo %%a %%b To print only the file name and size we can run the below command from a batch file. It will take some time for all the files to be listed, and it won't be sorted by size until everything is displayed. in the search box, and when the results start to appear, click the 'Size' column heading. If you want to do that across an entire drive, you can type. The above command prints file modified time also. You can sort by size, so that the largest files appear at the top of the list.

For example, to get file size for mp3 files, we can run the command ‘ dir *.mp3‘. We can also get size for files of certain type. We can use ‘*” to get the file sizes for all the files in a directory.
