Find number of files in a folder?

Page 1 of 2 12 LastLast

  1. Posts : 25
    Windows 7 Ultimate x64
       #1

    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 Computer


  2. Posts : 1,127
    Win7U 64 RTM
       #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 Computer


  3. Posts : 25
    Windows 7 Ultimate x64
    Thread Starter
       #3

    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 Computer


  4. Posts : 1,127
    Win7U 64 RTM
       #4

    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 Computer


  5. Posts : 222
    Win 7 Ult + Starter, XP Pro +Home, 2kAS, Linux Mint 8, SuperOS
       #5

    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
    Last edited by fafhrd; 05 May 2011 at 05:02. Reason: att.image
      My Computer


  6. Posts : 25
    Windows 7 Ultimate x64
    Thread Starter
       #6

    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 Computer


  7. Posts : 1
    Windows 7
       #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 Computer


  8. Posts : 1
    windows 7 home x32
       #8

    Right click parent folder, and select properties. The number of files and folders is included it the resulting dialog.
      My Computer


  9. Posts : 10,200
    MS Windows 7 Ultimate SP1 64-bit
       #9

    premson86 said:
    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 Computer


  10. Posts : 10,200
    MS Windows 7 Ultimate SP1 64-bit
       #10

    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 Computer


 
Page 1 of 2 12 LastLast

  Related Discussions
Our Sites
Site Links
About 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 07:02.
Find Us