You are not logged in.
Pages: 1
Is it possible to get a list of folders and their size using robocopy.
I have a drive with a hundred or so folders that i need to find the size of. Each folder has many su-folders but I only want the sum of the top level folders. I can do this with diruse but that is not possible in this case.
Offline
It might take a while, but you could do something like this:
@echo off
if "%~1" EQU "" (set "root=%CD%") else (set "root=%1")
for /d %%D in ("%root%\*") do (
for /f "usebackq tokens=2,3 delims=: " %%a in (`robocopy /l /s /nfl /ndl /njh "%%D" "%TEMP%\iMustNotExist%random%%random%" ^| findstr "\<Bytes\>"`) do (
set /p "out=%%D is %%a" <nul
if "%%a" NEQ "%%b" (echo: %%bbytes) ELSE (echo: bytes)
)
)
Last edited by bluesxman (19 Aug 2014 09:20)
cmd | *sh | ruby | chef
Offline
This works just like I wanted it to.
Thank you sir..
Offline
Pages: 1