Go Back  DVD Talk Forum > General Discussions > Tech Talk
Reload this Page >

nr of files per directory?

Tech Talk Discuss PC Hardware, Software, Internet and Other Technology

nr of files per directory?

Old 10-30-07, 08:53 PM
  #1  
Senior Member
Thread Starter
 
Join Date: Mar 2003
Posts: 789
Likes: 0
Received 0 Likes on 0 Posts
nr of files per directory?

Hi,

I need some software that tells me the number of files per directory. It should be able to do this recursively in all the subdirectories as well, and report the number of files in each subdirectory.

I'd think this should be possible with DOS, but it appears not to be that easy.

Any ideas?
Old 10-31-07, 12:18 PM
  #2  
DVD Talk Hall of Fame
 
joeblow69's Avatar
 
Join Date: Jan 2000
Location: Palm Springs
Posts: 9,469
Received 6 Likes on 4 Posts
you mean something like "dir /s" in dos ?
Old 10-31-07, 02:01 PM
  #3  
Senior Member
Thread Starter
 
Join Date: Mar 2003
Posts: 789
Likes: 0
Received 0 Likes on 0 Posts
Originally Posted by joeblow69
you mean something like "dir /s" in dos ?
I know dir /s will show all the files, including subdirectories, so that is a first step.

What I need is to know how many files are in the respective folders. I basically just need a report on the nr of files. I do not need to see the actual filenames or anything. So ideally, I'd get a report like this:

Rootdir: 23
--> subdir1: 10
--> subdir2: 8
----->subsubdir1: 5
----->subsubdir2: 3
--> subdir3: 5

Thanks!
Old 10-31-07, 02:52 PM
  #4  
DVD Talk Hall of Fame
 
joeblow69's Avatar
 
Join Date: Jan 2000
Location: Palm Springs
Posts: 9,469
Received 6 Likes on 4 Posts
Well you could do something like this:

dir /s | findstr /c:"Directory of" /c:"File"

The parsing would get a little screwed up if you have a file or dir with the string "File" in it, though.
Old 10-31-07, 03:13 PM
  #5  
Senior Member
Thread Starter
 
Join Date: Mar 2003
Posts: 789
Likes: 0
Received 0 Likes on 0 Posts
Originally Posted by joeblow69
Well you could do something like this:

dir /s | findstr /c:"Directory of" /c:"File"

The parsing would get a little screwed up if you have a file or dir with the string "File" in it, though.
Hmm. This is not bad! I redirected the output to a log.txt file, and now I can go through that one to see which directories contain tons of files. Thanks!

Still, if there were some GUI program that would do this, that would be better.

Thanks!

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On
Trackbacks are Off
Pingbacks are Off
Refbacks are Off


Thread Tools
Search this Thread

Archive - Advertising - Cookie Policy - Privacy Statement - Terms of Service - Do Not Sell My Personal Information

Copyright 2018 MH Sub I, LLC dba Internet Brands. All rights reserved. Use of this site indicates your consent to the Terms of Use.