Windows 7 Forums
Welcome to Windows 7 Forums. Our forum is dedicated to helping you find support and solutions for any problems regarding your Windows 7 PC be it Dell, HP, Acer, Asus or a custom build. We also provide an extensive Windows 7 tutorial section that covers a wide range of tips and tricks.


Windows 7: Find number of files in a folder?


04 May 2011   #1

Windows 7 Ultimate x64
 
 
Find number of files in a folder?

OK. I have been trying to figure this out for over a week now with no luck. I know I can right-click and select properties to see the number of files and sub-folders in any folder. My problem is that I would like to know the number of files NOT INCLUDING hidden files and folders.

Is there any way to get the count to disregard the hidden and system files without manually counting, as the folder I am really interested in has thousands of files in hundreds of folders and I need to check on a regular basis?

My System SpecsSystem Spec
.

04 May 2011   #2

 
 

You could uncheck 'Show hidden folders', then check the count by opening the folder and using the hotkey ctrl+A to select all the files in the folder. The number of files should be shown in the status bar (at bottom left).


That said, if there are sub folders, ctrl+A will select those and the files in them will be counted as well. You can circumvent that by manually selecting just the files in the given directory (mouse click 1st file, hold down shift, mouse click last file).

If you generally show hidden files, you can make quick work of the process by adding show/hide hidden files to the context menu.

James
My System SpecsSystem Spec
04 May 2011   #3

Windows 7 Ultimate x64
 
 

I understand this. The problem is the folder contains HUNDREDS of sub folders. If I did this I would still have to go into each folder separately to count and then add them all up manually. Do you see where I'm coming from?

I am starting to get the feeling there is no way to do what I want. Sigh.....
My System SpecsSystem Spec
.


04 May 2011   #4

 
 

Quote:
I am starting to get the feeling there is no way to do what I want.
If Windows 7 can do this, it would likely be via a script or commandline batch file. Maybe someone will chime in. If not, a 3rd party utility might be a possibility.

You could try asking here:

The Official Scripting Guys Forum! Forum

James
My System SpecsSystem Spec
05 May 2011   #5

Win 7 Ult + Starter, XP Pro +Home, 2kAS, Linux Mint 8, SuperOS
 
 

Searchmyfiles - freeware, single 50KB executable, does not need to be installed, does not index files

Alternative to Windows Search For Files + Duplicates Search

Does this easily - browse to the folder you want, make sure you deselect the subfolder depth, find files, and start search - the number of files is found in the status bar of the searchmyfiles results window
Find number of files in a folder?-smf.png

Forgot to mention the attributes switches etc

Karen's directory printer will also do what I think you want over multiple subfolders

http://www.karenware.com/powertools/ptdirprn.asp


My System SpecsSystem Spec
06 May 2011   #6

Windows 7 Ultimate x64
 
 

Wow. Great app. It seems there is no way to do this in windows 7 itself but thanks to this little app I can now be a file-searching rock star.

Thanks. This is the 3rd NirSoft app that has saved the day. I should just look at thier site first from now on.
My System SpecsSystem Spec
29 Mar 2012   #7

Windows 7
 
 
Use Powershell commmand

Use the below comand in windows powershell
(Get-ChildItem "C:\My Folder" -force -recurse).Count

This will give you the number of files in "C:\My Folder" including hidden and system file.
-recurse parameter includes files in sub folders.
My System SpecsSystem Spec
14 Jul 2012   #8

windows 7 home x32
 
 

Right click parent folder, and select properties. The number of files and folders is included it the resulting dialog.
My System SpecsSystem Spec
14 Jul 2012   #9

MS Windows 7 Ultimate SP1 64-bit
 
 

Quote   Quote: Originally Posted by premson86 View Post
Use the below comand in windows powershell
(Get-ChildItem "C:\My Folder" -force -recurse).Count

This will give you the number of files in "C:\My Folder" including hidden and system file.
-recurse parameter includes files in sub folders.
you might want to add the erroraction of silentlycontinue, e.g.,

(dir "C:\Windows" -fo:$true -ea silentlycontinue -rec).Count

try both with and without to see the difference.
My System SpecsSystem Spec
14 Jul 2012   #10

MS Windows 7 Ultimate SP1 64-bit
 
 

premson,
You also might find this interesting:
(dir $env:systemdrive\boot -fo:$true -ea silentlycontinue -rec | where {($_.PSIscontainer -ne $true) -AND ($_.mode -notmatch "hs")}).count


I changed to \boot to shorten the run time. Would be quicker by using -filter rather than the where clause.

Oh yes, the above excludes folders, hidden files, and system files.
My System SpecsSystem Spec
Reply

 Find number of files in a folder?




Thread Tools




Our Sites

Site Links

About Us

Find Us

Windows 7 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 7" and related materials are trademarks of Microsoft Corp.

Designer Media Ltd

All times are GMT -5. The time now is 03:26 AM.
Twitter Facebook Google+



Windows 7 Forums

Seven Forums Android App Seven Forums IOS App
  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33