Windows Explorer-- Determining memory contained in a subdirectory

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I want to clean up a directory. I was wondering if there is a way to list all
the subdirectories contained in the directory and the corresponding amount of
space taken up by each subdirectory.
 
I want to clean up a directory. I was wondering if there is a way to list all
the subdirectories contained in the directory and the corresponding amount of
space taken up by each subdirectory.

@echo off
if {%1}=={} @echo Syntax CleanUpDir Folder&goto :EOF
setlocal
set folder=%1
@echo Directory:%1
for /f "Tokens=*" %%a in ('dir /a /ad /b /s %folder%') do (
for /f "Tokens=2,3" %%b in ('dir /a "%%a"^|FIND "File(s)"') do @echo "%%a","%%c"
)
endlocal
 
I wrote my own utility program that does just that & its available on the
microsoft.public.dotnet.language.vb newsgroup. Its compiled & there is also
the source code

Crouchie1998
BA (HONS) MCP MCSE
 
How do I go about implementing this code?

Jerold Schulman said:
@echo off
if {%1}=={} @echo Syntax CleanUpDir Folder&goto :EOF
setlocal
set folder=%1
@echo Directory:%1
for /f "Tokens=*" %%a in ('dir /a /ad /b /s %folder%') do (
for /f "Tokens=2,3" %%b in ('dir /a "%%a"^|FIND "File(s)"') do @echo "%%a","%%c"
)
endlocal
 
Put it in a New Text File and rename it to jerolds.bat. Then open a command prompt and in the location where this file is type jerolds.
 
I apologize for not knowing this, but I went to the newsgroup below and
wasn't sure exactly where to look for this code you are talking about. I'm
sort of a newsgroup beginner...

Once in that newsgroup, how do I go about finding the code?
 
Try using default newsreader, outlook express. Then its easier to track your
posts.As it is you've started a new thread, and no one here knows what your
talking about.
 
Back
Top