Windows Count Number Of Files

Dec 29, 2018  How to Count Number of Files or Subfolders Inside a Folder 1. View Properties. This is probably one of the easiest methods to know what lies within. Use File Explorer. File Explorer lets you browse all the files and folders inside your hard. Command Prompt. Quite a few Windows users.

Windows 8 and Windows 10

  1. Open Windows Explorer.
  2. Browse to the folder containing the files you want to count. As shown in the picture below, in the right details pane, Windows displays how many items (files and folders) are in the current directory. If this pane is not shown, click View and then Details pane.
Notice

If hidden files are not shown, these files will not be counted.

Notice

If any file or folder is highlighted, only the selected items will be counted.

TipWindows count number of files in folder

Use the search box in the top-right corner of the window to search for a specific type of file. For example, entering *.jpg would display only JPEG image files in the current directory and show you the count of files in the bottom corner of the window.

Tip

If you need to use wildcards or count a more specific type of file, use the steps below for counting files in the Windows command line.

Microsoft Windows Vista and 7 users

  1. Open Windows Explorer.
  2. Browse to the folder containing the files you want to count. As shown below, in the bottom left portion of the window, it displays how many items (files and folders) are in the current directory.
Notice

If hidden files are not shown, these files will not be counted.

Notice

If any file or folder is highlighted, only the selected items will be counted.

Tip

Windows Count Number Of Files In Directory And Subdirectory

Use the search box in the top-right corner of the window to search for a specific type of file. For example, entering *.jpg would display only JPEG image files in the current directory and show you the count of files in the bottom corner of the window.

Tip

If you need to use wildcards or count a more specific type of file, use the steps below for counting files in the Windows command line.

Microsoft Windows XP users

  1. Open Windows Explorer.
  2. Browse to the folder containing the files you want to count.
  3. Highlight one of the files in that folder and press the keyboard shortcutCtrl+A to highlight all files and folders in that folder. Once all files have been highlighted, in the Explorer status bar, you'll see how many files and folders are highlighted, as shown in the picture below.
Notice

If hidden files are not shown, these files will not be selected.

Tip

You can also individually count a specific type of file, like only counting image files. Click on the type column header to sort the files by type and then highlight the first file type you want to count. Once the first file is highlighted, hold down the Shift key and while continuing to hold it down, press the down arrow key to individually select files. If there are lots of files, you can also hold down the Shift key and press the Page down key, which will highlight files a page at a time.

Tip

If you need to use wildcards or count a more specific type of file, use the steps below for counting files in the Windows command line.

Microsoft command line (DOS) users

  1. Open the Windows command line.
  2. Move to the directory containing the files you want to count and use the dir command to list all files and directories in that directory. If you're not familiar with how to navigate and use the command line, see our How to use the Windows command line (DOS) page.

As seen above, at the bottom of the dir output, you'll see how many files and directories are listed in the current directory. In this example, there are 23 files and 7 directories on the desktop.

Tip

To count a specific type of file in the current directory, you can use wildcards. For example, typing dir *.mp3 would list all the MP3 audio files in the current directory.

Tip

To count all the files and directories in the current directory and subdirectories, type dir *.* /s at the prompt.

Linux users

Windows Count Number Of Files Download

To list the count of files in Linux, use the ls command piped into the wc command, as shown below.

To prevent any confusion, the above command reads ls <dash><the #1> <pipe> ls <dash><the letter l>. This command uses the ls command to list files in a bare format, and pipes the output into the wc command to count how many files are listed. When done properly, the terminal should return a single number indicating how many lines were counted and then return you to the prompt.

Tip

Keep in mind that this is also counting the ./ and ../ directories.

Windows Count Number Of Files In Subfolders

You can also add the grep command to find a more exact count of the files you want to count, as shown below.

Files

In the above example, the command only counts files that begin with the letter 'a'. The regular expression ^a could be replaced with any valid grep command, or you could replace the letter 'a' with another letter.

macOS users

  1. Open the folder containing the files you want to count.
  2. In that folder,you should see at the bottom center of the window how many objects are listed, as shown in the example picture below.

Windows Script To Count Number Of Files In A Directory

Additional information

  • See our count, directory, file, and folder definition for additional information about each of these terms.

Hi,

after noticing the same issue today while i was checking out my new backup system, the file count was incorrect and i used indeed the treesize to be sure the backups file count was correct.

I found out a group policy for windows 10 that you can go beyond the limit off 260 characters didn't help...

Than i found the next small program tlpd https://sourceforge.net/projects/tlpd/ ( TLPD is designed to tackle the 'path name too long' issue.)

open it as an admin, and select drive,folder...than it ask to type an max limit, i tried a few, ended up at 240, changed all the file names that are more than 240 characters, than i clicked again on my wrong folder file count, properties and now it shows me the correct file number and folders...

Windows Count Number Of Files

Windows Count Number Of Files Free

i checked my nas but the file count was here still incorrect, probably because network name and backup folder characters, again tlpd scan against it , and showed me a few files above the 240 limit, changed them on the source and backup and after that file count source and backup are correct

i know its work around, but it worked :)

windows 10 pro 64 bit version 1803 build 17134.137

Windows Count Files In Directory

Regards Dave