Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ::¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦ Directory Size ¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦::
- :DirSize
- CD %UserInputPath%
- FOR /F "tokens=*" %%a In ('"Dir /S /-C /A | Find "bytes" | Find /V "free""') Do Set xsummary=%%a
- FOR /F "tokens=1,2 delims=)" %%a In ("%xsummary%") Do Set xfiles=%%a&Set xsize=%%b
- Set xsize=%xsize:bytes=%
- Set xsize=%xsize: =%
- Set /A xsize="%xsize:~0,-3%/1024*100/1024"
- Echo Directory size (GB): %xsize:~0,-2%.%xsize:~-2%
- CD %~dp0
- GOTO :EOF
Advertisement
Add Comment
Please, Sign In to add comment