Technology in terms you understand. Sign up for the Confident Computing newsletter for weekly solutions to make your life easier. Click here and get The Ask Leo! Guide to Staying Safe on the Internet — FREE Edition as my thank you for subscribing!

Why Are There So Many Files?

You may think you have only a few, but Windows has other ideas.

Your computer likely has many more files on it than you realize. That's quite normal.
Over a million files scanned.
(Screenshot: askleo.com)
Question: I did a Windows Defender full scan and it scanned over 117,000 files on my computer. Where in the world did they come from?

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!

TL;DR:

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.

Counting files

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.

Disk Usage of the Windows folder.
The command to show disk usage of the Windows folder. (Screenshot: askleo.com)

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.

If I run the command at the root of the drive1 — “C:\” — I get the information on everything stored on that hard drive.

Disk usage of the entire hard drive.
“Du” command displaying disk usage of the entire hard drive. (Screenshot: askleo.com)

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:

Scan of a single .xlsx file.
Scan of a single .xlsx file. (Screenshot: askleo.com)

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).

Microsoft Office disk usage.
Microsoft Office disk usage. (Screenshot: askleo.com)

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.

Do this

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.

P.S.

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.

Podcast audio

Play

Footnotes & References

1: You likely want to run Command Prompt “as” administrator to get a complete report including files not otherwise available.

2: Today I Learned

3: These are actually .zip files, just with a different name.

13 comments on “Why Are There So Many Files?”

  1. It’s necessary for antimalware programs to check individual files inside compressed files. Otherwise, it would be easy to hide malware inside .zip or other compressed files.
    For example, Gmail wouldn’t allow me to send .exe, .dll or other executable files. I used to compress them using .rar and they would get through Gmail’s filters. Hopefully, Gmail has fixed that and checks more compression formats.

    Reply
  2. My C: drive is running out of room. It appears that it’s because of extra program files that I don’t need. How do I get rid of some of the “junk” to make more room for my data files and the all-important working cache?

    Reply
  3. I get the fact that Windows is so large because it is multi-purpose. But does that excuse Windows making things even worse by locking the Temporary Internet Files folder in Disk Cleanup? Perspiring minds want to know!

    Non-comprehendingly,

    James

    Reply
  4. Hello Leo. When I click to accept a cookie on a website, why do I have to do it again every time I visit the site? I thought the point of a cookie was to store easily-referenced info already gathered. Why doesn’t the website look for a previously stored cookie and – if already there – not bother to ask the operator to click to rewrite it?

    Reply
    • Do you have a browser option set to clear cookies on exit? Or do you run some kind of cleaning utility?
      If it’s just one site, I’d blame that site’s implementation.
      And I hate that cookie notification requirement. It’s so stupid.

      Reply
    • Clicking to accept cookies is because of European data protection laws. They require a website get permission before placing a cookie. A well designed website would include an ‘accepted cookies’ cookies and not pop that question again for a while. Since that popup is just to comply with the law, many web developers slapped the warning in without as much thought as the should have.

      Reply
  5. Hello Mark,
    I have tried that, along with every other suggestion that I’ve been able to find on the interwebs, and nothing, and I mean absolutely nothing has worked so far. Now the folder has 700 MB, and continues to grow larger every day. I am at (what passes for) my wit’s end. At the risk of being even more masochistic, what else might I try?

    Head-bashingly,
    James

    Reply
  6. For disk cleanup, try Microsoft’s PC Manager (beta). https://pcmanager.microsoft.com/en-us. I used to like CCleaner, but it’s become a sales tool for Avast security software (who bought CCleaner), and it even installs Avast on PCs that already have antivirus installed, if you let it. I find PC Manager to be simple and effective.

    Reply

Leave a reply:

Before commenting please:

  • Read the article.
  • Comment on the article.
  • No personal information.
  • No spam.

Comments violating those rules will be removed. Comments that don't add value will be removed, including off-topic or content-free comments, or comments that look even a little bit like spam. All comments containing links and certain keywords will be moderated before publication.

I want comments to be valuable for everyone, including those who come later and take the time to read.