So it will get sizes above 2 GiB wrong 1. However, this has several problems because cmd is limited to 32-bit signed integer arithmetic. You can just add up sizes recursively (the following is a batch file): offįor /r %%x in (folder\*) do set /a size+=%%~zx