Submitted By: Anonymous Submission

Two-part command shell script that emulates the output of the Unix du command. You must copy the code for sizeof.cmd and dirsize.cmd into two files with those names, and both files must be in the same directory when run.

Visual Basic
Edit|Remove
sizeof.cmd
----------------------------
@echo off
pushd %1
for /R %%X in (.) do for /F "usebackq tokens=2* delims=)" %%I in (`dirsize.cmd %%~sX`) do @echo %%~fX : %%I
popd
----------------------------

dirsize.cmd
----------------------------
@echo off
dir "%1" | findstr "File(s)"
----------------------------