Contents
How to Count Number of Files or Subfolders Inside a Folder
I’ve moved my data to Google Drive but still have a lot on my hard drive. Checking subfolders and files within the main folder can be tedious. I’m sure many of us have encountered this situation before.
This can be troublesome, especially if there are multiple layers of subfolders with files saved within them. Counting them manually is impractical and tedious. To address this issue, I’ll share some methods to determine the total number of subfolders and files within a folder.
1. View Properties
One of the easiest ways to determine the content of a folder is by using this method. No additional software is required. Simply locate the folder or subfolder you want to analyze, right-click on it, and select Properties from the menu that appears. Alternatively, you can press ALT+Enter to access the folder or subfolder’s Properties.
Depending on your computer’s specifications and the folder’s size, it may take a moment for Windows to calculate the information. Once the calculation is complete, you will be able to see the total size of the main folder, the subfolders contained within it, and the number of files in both the subfolders and sub-subfolders.
Note:
File Explorer allows you to browse files and folders on your hard drive. You can launch it by pressing Windows Key+E or going to My Computer and selecting the correct partition. File Explorer can also be used to find the number of subfolders or files in a folder.
Open the folder and select all subfolders or files manually or by pressing CTRL+A. If selecting manually, you can choose which files to include or omit.
You can now see the total count near the bottom left of the window. Repeat the same for files inside a folder and subfolder. This is useful when you need to know the total count inside a specific folder.
3. Command Prompt
Quite a few Windows users enjoy using the command prompt. It can be a powerful tool if you know how to use it and remember the correct commands. This one is for those who use the command prompt. Press the Windows key and type RUN to open the Run dialog box. Type cmd and hit enter to launch the command prompt.
When you open a new window, you’ll see a black background with white text. To access the folder, enter its path. First, use the CD command to change the drive from C to H. Then, use CD/ to go back to the root folder of C Drive and type the drive letter with a colon (H:). Finally, enter the folder path using the CD command.
The CD command changes directory, while the DIR command works with directories. To count all files and subfolders within a parent folder or directory, use this command: “dir *.* /w /s”.
Don’t worry if the text scrolls automatically. In the end, you can see the total number of files and directories inside the primary folder. That includes all the files and folders as the command is recursive.
4. PowerShell
Feeling geeky? For advanced users, there’s PowerShell, one step above the command prompt in difficulty. Use Windows search to find it.
A new window will appear with a blue background. Navigating to your desired folder is easier in PowerShell. Simply type “cd” followed by your folder structure. For example, “cd h:\database”.
To count files and subfolders in a parent folder, use this command: “Copy and paste the following command: Get-ChildItem Measure-Object %.” The result may differ if the command is not recursive, meaning it will only count one level deep. In this case, there are 5 subfolders.
To count all files and folders recursively:
Get-ChildItem -Recurse | Measure-Object
To count only folders recursively:
Get-ChildItem -Recurse -Directory | Measure-Object
To count only files recursively:
Get-ChildItem -Recurse -File | Measure-Object
5. WizTree
Finally, let’s review WizTree, a software that simplifies life and provides insight into the files in a folder. WizTree is a hard drive analyzer that collects data metrics such as file extension count, space usage for each format, and size of individual files and folders.
Clicking on the ‘+’ icon next to a folder reveals the tree structure, including individual details. This allows you to navigate folders and subfolders without switching between them.
There are various ways to count the number of files and folders/subfolders in a main folder. You can use the built-in Windows Explorer or the more powerful WizTree software, which also provides additional details in a tree structure.
Also, find out how to record Skype calls on Windows 10 for important meetings or conversations.
As Fred Humiston, the author behind Twothirds.us, I focus on providing practical and easy-to-follow guides and solutions for a variety of technical issues that people commonly face.
My articles cover a wide range of topics, from troubleshooting out-of-sync audio on TikTok and managing Firestick devices, to understanding the impact of Capcut on video quality and resolving sound issues on Hisense Roku TVs.
I also delve into more general tech tips, like how to block numbers on landlines or use VPNs without Wi-Fi. My goal is to make technology more accessible and less intimidating for everyone, whether you’re a tech novice or a seasoned user. I strive to offer clear, concise, and helpful advice to make your digital experience smoother and more enjoyable.