You may think you have only a few, but Windows has other ideas.
Only 117,000? That seems light.
Pictured above is the result of my recent scan of one of my Windows 11 demo machines showing over a million files. 1,000,000!
While I’m always tempted to answer “why” this way, let’s dive into some of what’s going on.
Become a Patron of Ask Leo! and go ad-free!
So many files
Windows itself is made up of thousands of files that implement its massive feature set and security. Applications are also typically made up of hundreds if not thousands of files, and create even more data files associated with your account. Also, Windows Defender might look like it’s over-reporting the number of files scanned because it counts the contents of archive files separately.
As we’ll see in a moment, Windows Security counts files in an odd way. We need a better way to count files.
SysInternals Tools to the rescue. When installed, it adds a command line tool called “du” for disk usage.
In this example, with “C:\Windows” as my current directory, running “du .” calculates the usage of that folder and all subfolders. My Windows folder has 78,404 files and 39,329 folders and takes up roughly 11GB of disk space.
147,041 files on this machine.
But wait… that’s not the same as the million and change reported by Windows Security’s full scan. What gives?
Files contain files
TIL2 that Windows Defender:
- Scans the contents of many archives, including zip files and others.
- Counts the contents of those archives as separate files.
If I create a zip file containing two files and then scan it with Windows Defender, the scan reports three files: the physical zip file itself plus the two files it contains.
There are a lot of archive files in Windows. Zip files are perhaps the best known, but “msi” (Microsoft InStaller) files, “cab” (Cabinet) files, and even Microsoft Office’s ‘x’ series of files3, like “docx”, “xlsx”, “pptx”, and so on, are all single files that contain other files. Sometimes a LOT of other files.
If you right-click on one example Excel .xlsx file and select “Scan with Microsoft Defender…” you’ll get this result:
The single .xlsx file contains 34 files scanned and reported separately by Windows Defender.
Windows is big and general-purpose
One of the reasons there are so many files included in Windows itself (for example, the 78,404 files in my C:\Windows folder) is that it provides a truly massive number of features and functionality. Many more than you might imagine. And even if you don’t use everything Windows has to offer, all the files for its operation are there just in case.
On top of that, many files are duplicated as real-time backups. The System File Checker, for example, will fetch a backup copy of a file should it determine that a file’s primary copy has been damaged.
One of the most common responses is “Why not just have a lite/smaller/consumer version?” Unfortunately, down this path lies much confusion and more instability. Windows is complex enough without adding additional combinations of features and functionality in some editions and not others. In a sense, they already do in the Home/Pro versus Enterprise editions. That’s complicated enough.
Besides, what you would want in a lite version probably doesn’t match what I or someone else might want. Slowly but surely, we’d arrive back at something resembling the current Home and Pro editions.
Applications are massive
Microsoft Office/Microsoft 365 is installed on this machine, and it has over 8,000 files (not including data and configuration files stored in other folders).
Once again, Office is a large application with many, many features whether you use them or not.
While Office might be one of the larger applications you install, it’s not uncommon for even simple applications to be made up of hundreds of separate files, particularly if they’re multi-lingual.
It all adds up.
Data adds up
The one that surprised me was the “AppData” folder associated with my login account. I found over 26,000 files there.
This is where applications (including Windows itself) store data that is unique to your login account. For example, Microsoft Office is responsible for over 5,000 files here. These are files that preserve the options you’ve selected and the program configuration specific to your login, history, and who knows what else.
Most programs store some amount of information here, and since it’s typically something you never see, application authors sometimes go a little nuts with how they divvy up the data they preserve on your behalf.
There’s really nothing to do here other than don’t be surprised by the large number of files on your system, especially the large number of files reported by Windows Defender’s full scan. It’s all part of how Windows and Windows applications are organized.
Be sure to subscribe to Confident Computing! It’s my weekly newsletter that gives less frustration and more confidence, solutions, answers, and tips in your inbox every week.
My Ubuntu Linux server (no graphical interface, command line only) has 170,000 files, and a relatively recent reinstall of my Mac Pro running macOS Monterey appears to have over 2 million.