Here is a simple trick that will show you how to count the number of items in a folder on Windows 11/10. You can do it via File Explorer or by using PowerShell.
How to count the number of items in a folder
1] Via Explorer
To see how many items are there in the Recycle Bin:
- Open the concerned Folder
- Select one item
- Press Ctrl+A
- Look in the bottom left corner.
- You will see the number there.
2] Using PowerShell
Run PowerShell as an administrator, using the Taskbar search, type the following and hit Enter:
Write-Host (dir <folder-path> | measure).Count;
Here replace <folder-path>
with the actual path. For example:
Write-Host (dir D:\Wallpapers | measure).Count;
The number will be displayed.
How do I count files in a folder and subfolders?
If you want to count the total number of files (TXT, ZIP, EXE, etc.) present in a parent folder and its sub-folders in Windows 11/10, then use the folder’s Properties box. Select the folder and use the Alt+Enter hotkey to open its Properties box. There, you will see a Contains field that shows the total number of files and sub-folders separately.
How do I print a list of files in a folder in Windows 11?
To print a list of files in a folder (including its sub-folders) in Windows 11, first, open the Command Prompt window in a folder. Access your folder in File Explorer, type cmd in its address bar, and hit the Enter key. After that, use the following command:
dir > List.txt
Once the command is completed, a TXT file will be created in the same directory. That TXT file contains a list of all files including the file extension, date modified, and time for each file.
That’s all!
Now, some of you might want to take a look at this Windows File Explorer Tips and Tricks post.