Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Dos Command/Batch file to find a folder size

2»

Comments

  • u2plodu2plod Member Posts: 6
    Although I don't understand it, I like your script.

    I have a slightly different need though. I would like to monitor folder sizes over time and need something that can dump recursive folder sizes into a text file, eg.

    99999M C:
    99999M C:Program Files
    99999M C:Program FilesAdobe
    ...
    99999M C:Windows
    99999M C:Windowswinsxs
    ...

    I will then manipulate this output in the way I want. Are you able to devise a script that can produce the above output?
  • u2plodu2plod Member Posts: 6
    Although I don't understand it, I like your script.

    I have a slightly different need though. I would like to monitor folder sizes over time and need something that can dump recursive folder sizes into a text file, eg.

    99999M C:
    99999M C:Program Files
    99999M C:Program FilesAdobe
    ...
    99999M C:Windows
    99999M C:Windowswinsxs
    ...

    I will then manipulate this output in the way I want. Are you able to devise a script that can produce the above output?
  • u2plodu2plod Member Posts: 6
    Although I don't understand it, I like your script.

    I have a slightly different need though. I would like to monitor folder sizes over time and need something that can dump recursive folder sizes into a text file, eg.

    99999M C:
    99999M C:Program Files
    99999M C:Program FilesAdobe
    ...
    99999M C:Windows
    99999M C:Windowswinsxs
    ...

    I will then manipulate this output in the way I want. Are you able to devise a script that can produce the above output?
  • nashenaas1nashenaas1 Member Posts: 1
    Hi all.
    I want to change this cod to work in loop mode and list name & size & filecountall of each subfolders.
    But in output of new code; just "folder name" is changed and "foldersize" & "foldercount" for all subfolder is the same.
    Please correct this code and help me.
    Thanks.
    @echo off
    for /d %%D in (".*") do (
    echo "%%D"
    For /F "tokens=*" %%a IN ('"dir /s /-c /a "%%D" | find "bytes" | find /v "free""') do Set xsummary=%%a
    For /f "tokens=1,2 delims=)" %%a in ("%xsummary%") do set xfiles=%%a&set xsize=%%a
    Set xsize=%xsize:bytes = %
    Set xsize=%xsize: = %
    echo %xsize%
    echo %xfiles%
    )
2»
Sign In or Register to comment.