3ll0s

Directory Size

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