7 steps to a lean, clean Windows machine

CONTINUA APÓS A PUBLICIDADE

These days, a relatively clean and uncomplicated Windows 10 or 11 system disk might be home to more than 250,000 files and 90,000 folders. A more complex, application-heavy system disk might contain between half a million and a million files. My Windows 10 production PC has over 2.9M files and 750K folders, for example. My brand-new Lenovo Yoga Slim 7x Copilot+ PC has over 250K files and 55K folders. That’s a lot of stuff!

CONTINUA APÓS A PUBLICIDADE

Indeed, all those files need not necessarily hang around. That’s why it’s a good idea to practice regular disk hygiene. This is exactly what is explained and explored here, with plenty of examples and screen shots to illustrate the cleanup process. Best of all, the tools that help you tidy up won’t cost you a dime.

Step 1: Run built-in Windows disk cleanup tools

From time immemorial, Windows has included a utility for cleaning up disk space — namely, Disk Cleanup, also known as cleanmgr.exe. In Windows 10 and 11, users gained a second method to clean up disk space as part of the Settings-based “Storage Sense” facility aimed at optimizing storage.

There has been speculation that Disk Cleanup might disappear as Settings takes over Windows management and controls. Even so, the Disk Cleanup utility remains ready, willing, and able to work in in Windows 10 22H2 and Windows 11 24H2 as I write this story. Either the Settings or Disk Cleanup approach provides a great way to excise extraneous and unneeded Windows files (for Windows 10 and 11 versions across the board).

Option A: Run Disk Cleanup

  1. To launch Disk Cleanup, type disk clean or cleanmgr.exe into the Start menu search box.

2. The Disk Cleanup desktop app should appear at the top of those search results. If you can, select Run as administrator from the resulting options menu. Why? Only then does it offer to clean up redundant or outdated OS files (such as old OS files after an upgrade, or old updates) as well as other Windows leftovers.

3. Select the drive letter for the disk you wish to clean (for many readers this will start with the C: drive where Windows itself resides). Click the OK button to start Disk Cleanup on its merry way.

After Disk Cleanup scans your system’s C: drive, Figure 1 shows a reasonable facsimile of what you’ll see in Windows 11.

disk cleanup utility in windows 11

Figure 1: Disk Cleanup can sometimes clear out tremendous dreck: 33.5GB in this case.

Ed Tittel / IDG

When you run Disk Cleanup as Administrator, you can clear out previous Windows installations as well as other files. In the example shown here, the earlier Windows installation alone accounts for 25.4GB, with a total potential savings of 33.5GB. That’s a huge chunk of space.

4. Scroll through the checkbox items in the pane labeled “Files to delete” and pick stuff you’d like to lose. The numbers in the right column indicate how much disk space each item occupies. Don’t delete old OS versions or updates if you think you might want to roll back. Note also that the Downloads item represents the contents of your personal Downloads folder, so don’t delete it unless you’re sure you don’t need anything in there.

5. When you’ve made your selections for files to delete, click OK.

This process can — and often does — take several minutes to complete. While it’s running, it looks like what’s shown in Figure 2.

disk cleanup in progress

Figure 2: While it’s running, Disk Cleanup shows a progress bar and its current cleanup focus.

Ed Tittel / IDG

Option B: Clean up via Settings

Settings-based cleanup in Windows 10:

1. In Windows 10, navigate to Start > Settings > System > Storage > Configure Storage Sense or run it now > Free up space now.

2. On the “Free up space now” pane, click the Clean now button shown in Figure 3, lower left.

srcset=” 601w, 246w, 572w, 138w, 69w, 394w, 296w, 205w” width=”601″ height=”732″ sizes=”(max-width: 601px) 100vw, 601px”>

Figure 3: Settings-based cleanup in Windows 10.

Ed Tittel / IDG

This cleans up storage in much the same way as if you’d run Disk Cleanup and clicked all available boxes — removing temporary files, update or upgrade files, delivery optimization files (designed for sharing on your local network but seldom used), obsolete device driver packages, and more. It will also empty the recycle bin. As with running Disk Cleanup, the “Free up space now” option in Settings often takes several minutes to run.

Settings-based cleanup in Windows 11:

Cleanup via Settings in Windows 11 works pretty much the same way, but looks quite different.

1. Navigate to Start > Settings > System > Storage Sense.

2. Scroll down and click the Run Storage Sense now button shown at the bottom of Figure 4.

srcset=” 517w, 230w, 129w, 65w, 369w, 277w, 192w” width=”517″ height=”673″ sizes=”(max-width: 517px) 100vw, 517px”>

Figure 4: To start Settings-based cleanup in Windows 11, click the “Run Storage Sense now” button.

Ed Tittel / IDG

When you do this, a progress indicator shows you it’s working: balls cycle from left to right, then repeat until it’s finished.

On another Windows 11 test PC, it reported, “We were able to free up 2.4GB of disk space.” Easy-peasy.

Step 2: Run PC Manager as a Disk Cleaner alternative

More properly identified as Microsoft PC Manager, this interesting Microsoft Store utility includes a wide-ranging, capable, and surprisingly fast Deep cleanup option, right on home screen. It’s at the lower left in Figure 5.

microsoft pc manager main window

Figure 5: The Microsoft PC Manager offers a useful “Deep cleanup” facility.

Ed Tittel / IDG

1. To use it, simply click Deep cleanup, and a details screen appears with a list of potential cleanup targets, as shown in Figure 6.

pc manager deep cleanup list

Figure 6: PC Manager’s “Deep cleanup” details, with pre-selected checkboxes (partial view).

Ed Tittel / IDG

Much like the options in Disk Cleanup (but more detailed), it’s a checkbox list of all the things that PC Manager finds that you can elect to clean up or not. By default, this facility checks the usual suspects, as you can see in Figure 6, where Windows Update cleanup items, error reports, temp files, and so forth are already checked.

2. Check the box next to any additional items you want to delete, and uncheck any items you don’t want to delete.

3. When you’ve made your selections, click the Proceed button at upper right to commence scrubbing!

When this facility finishes its work, it reports, “Cleanup completed” and shows the total amount of disk space freed up. Good stuff!

For more information about Microsoft PC Manager (which can do a lot more than clean up files), see section 4 of my November 2023 CW story “How to manually update Windows Defender.”

Step 3: Run UnCleaner to catch what Microsoft  tools miss

Josh Cell is a Francophone developer in Canada who’s built a peachy and free utility called UnCleaner. It can ferret out and remove temporary and obsolete log files that Windows’ built-in utilities and PC Manager don’t catch and kill. You can download the latest version of UnCleaner (1.7) from Major Geeks. Don’t worry that this tool shows a 2012 date: I can attest it still works fine on Windows 10 and 11 systems in mid-2024.

Running on the same production PC upon which I just ran Disk Cleanup and PC Manager’s Deep cleanup, UnCleaner found nearly 70MB of files to clean up despite a notionally clean status, as shown in Figure 7.

uncleaner main screen

Figure 7: UnCleaner can find and clean files that other tools miss.

Ed Tittel / IDG

Simply click the Clean button (lower left) to excise those files. After I did so on my system, UnCleaner’s total for potential cleanup dropped to under 50MB.

You’ll never get this tool to delete everything it reports, because some of those files are locked by Windows runtime constraints. Sometimes — if rarely, in my experience — you’ll see a message that says, “Good. Your system is very clean.” ‘Nuff said!

Step 4: Use DriverStore Explorer to dismiss obsolete device drivers

DriverStore Explorer (RAPR.exe) is a free, open-source tool that you can download from GitHub. Always be sure to grab the most current release (0.11.92 as of this writing). Unless you’re a real Windows driver wizard, you need only click two buttons to make RAPR do its thing: Select Old Driver(s) and Delete Driver(s).

1. You must run RAPR in administrator mode (right-click its icon and select Run as administrator). When you start it up, it can take up to a minute to scan the contents of your PC’s driver store. Eventually, you’ll see a list of installed drivers with checkboxes.

2. Click the Select Old Driver(s) button at the top right of the screen, and the program will automatically check the boxes for the older driver versions it finds. They’re highlighted with blue checkmarks in Figure 8.

Ed Tittel / IDG

I used a test PC on which I regularly run the Intel DSA (Driver and Support Assistant): it’s notorious for downloading multiple copies of the same driver. Careful examination of the text at the bottom of the screencap shows that RAPR finds 102 duplicate or obsolete drivers on this PC. Zounds!

3. Click the Delete Driver(s) button, and RAPR will attempt to remove all highlighted items. Thankfully, RAPR won’t actually remove any drivers it finds in use, so this is a surprisingly safe operation.

Notice in Figure 8 that a raft of Intel Bluetooth drivers represents items targeted for deletion. That’s because the Intel Driver & Support Assistant keeps on installing Bluetooth drivers (monthly, if not more often). This makes for lots of duplicates. The selections shown recovered 1GB of disk space and reduced the count of old drivers from 102 to 9 (mostly related to printing and/or graphics: Windows can hang on to them stubbornly).

I’ve seen some RAPR runs recover multiple gigabytes, but space savings are seldom larger than that. First-time users may recover 3 to 5GB when cleaning up numerous driver files. (Graphics drivers often exceed 1GB in size; those add up quickly.)

Power users and experts can find a lot more for RAPR to do (see “How to reduce Windows driver bloat” for details), but most regular users will simply enjoy its ability to clean up old, outmoded drivers.

Step 5: Use DISM to clean the Component Store

Most Windows OS files reside in the WinSxS folder, also known as the Component Store. After you install a cumulative update, and sometimes after other updates, the Component Store may contain duplicate, obsolete, or orphaned elements. You can use the Deployment Image Servicing and Management (DISM) tool at the command line to check the Component Store from time to time. Such checks will tell you if a cleanup is needed.

1. To get started, you’ll need to open an elevated PowerShell or Command Prompt window.

  • On the Windows desktop, press the Windows key and X, then select Windows PowerShell (Admin) from the resulting pop-up menu.
  • Alternatively, you can type powershell into the Start menu search box, then right-click Windows PowerShell and select Run as administrator from that pop-up menu.

2. In the Administrator: Windows PowerShell window that appears, type this string and hit Enter: dism /online /cleanup-image /analyzecomponentstore

You’ll see something like what’s shown in Figure 9.

Ed Tittel / IDG

As I wrote this story, I had just installed a Cumulative Update and other update items earlier that week. Sure enough, /analyzecomponentstore reported that there were two reclaimable packages ready for cleanup. Notice that the response text reported “Yes” in the field labeled “Component Store Cleanup Recommended.” That’s your clue that DISM has something it can clean up on your behalf.

3. To make that happen, in the Administrator: Windows PowerShell window, enter this string: dism /online /cleanup-image /startcomponentcleanup

The results appear in Figure 10, with an extra /analyzecomponentstore operation to show the results of the cleanup.

Ed Tittel / IDG

Please note the dual progress lines (the first goes only to 10%, the next all the way to 100%) after the /startcomponentcleanup operation: this is a well-known foible of DISM in x86 Windows versions (both 10 and 11). As far as I can tell, it’s an output glitch. DISM works properly.

Now let’s compare the numbers from the first and second /analyzecomponentstore operations, to wit:

  • Size of component store: 13.66GB vs. 9.11GB (diff: 4.55GB)
  • Actual size of component store: 12.75GB vs. 8.80GB (diff: 3.95GB)
  • Shared with Windows: 6.81GB vs. 6.78GB (diff: 0.03GB)
  • Backups and disabled features: 5.81GB vs 2.02GB (diff: 3.79GB)

If you add the savings for “Shared with Windows” and “Backups and disabled features,” you get 3.82GB, which is nearly the savings in the actual size of the component store (3.95GB) — just as it should be. Recently updated systems may recover up to 4 or even 5GB using this technique. (Actual results depend on the number and size of reclaimable packages removed.)

For more incredibly useful things you can do with DISM, see “Why DISM is the Swiss Army knife of Windows maintenance.”

Step 6: Inspect the system drive with WizTree

Once all preceding cleanups are complete, it’s a good idea to inspect the system drive to see where the big files are. I use the free, donation-ware WizTree program, but TreeSize Free is a worthy alternative. Both programs produce treemap diagrams — graphical renderings of disk contents that make it easy to spot big files and folders.

To run a scan of the ever-popular C: drive, here are the steps to follow:

1. Launch the WizTree application.

2. Select the C: (or some other) drive as the scan focus from the pull-down list just below the File and Options menus at upper left (see Figure 11).

3. Click the Scan button to the right of the selected drive. This generates a treemap diagram for the selected drive fairly quickly — usually under a minute, even on ginormous drives. (I just pointed it at a 4TB Hitachi drive and it finished in under 10 seconds.)

Figure 11 shows the C: drive from my Lenovo Yoga Slim 7x Copilot+ PC.

Ed Tittel / IDG

In this situation, you’re looking for big files, because getting rid of them provides useful, quick wins in the disk space recovery game. Right here, I see that the largest files are the ones you’d expect to see­ — namely, the system hibernation file (hiberfile.sys) and the system page file (pagefile.sys), in yellow-green near center right.

After those behemoths (6.1 and 1.0GB, respectively), the next largest is named USMT.PPKG. A quick lookup reveals this is output from the User State Migration Tool (USMT), used to snapshot Windows app files and settings. According to the Windows community, this information is part of the Windows Recovery Environment (WinRE) and is thus eminently worth keeping around. Indeed, I don’t see any obvious candidates for clean-up in this recently rebuilt Windows installation.

But let’s pick the USMT.PPKG file as an example anyway. Here’s how you’d get rid of it (or stop short, as we will do):

1. Position the cursor over the file of interest: USMT.PPKG, in this case.

2. Right-click to produce a pop-up menu.

3. On the pop-up menu, click Delete (2nd item from bottom) to remove the selected file. We’ll skip that this time.

By clicking other “big blocks” in the treemap, you can quickly figure out where your biggest potential space recovery opportunities lie. You won’t be able to get rid of all of them — the paging and hibernation files must stay, for example — but if some of them can go, big space savings can result.

For me, that’s often Windows ISO files I no longer want or need. (They usually consume 4GB to 6GB of disk space, so each one tossed is a savings in its own right.)

Step 7: Uninstall unused or unwanted Windows apps

If you really want to clear out some clutter on your disk, consider removing apps you don’t use. Here’s how:

1. Click Settings > Apps > Installed apps (in Windows 11) or Settings > Apps > Apps & features (in Windows 10). You’ll find yourself faced with a list of everything that’s currently installed on the target PC.

2. Off to the right of each app, you’ll see an ellipsis. This is Windows iconography that tells you clicking will show more options. Click the three-dot icon next to any app, and you’ll see a pop-up menu that includes some or all of the following options:

  • Modify
  • Repair
  • Uninstall

3. Getting rid of an app you never use is easy: simply click the Uninstall button.

If you pick the stuff you never use — with certain exceptions, including Microsoft Edge, the Microsoft Store, and the Settings app itself — you can then follow other cleanup recommendations earlier in the story to recover the disk space they would otherwise consume.

The best guidance on this topic comes from Windows 10 Forums and Windows 11 Forum, where you’ll find tutorials that include “uninstall apps” in their titles. Highly recommended to help you pick things to scrap, if you’re of a mind to do so. I remove third-party apps I’m no longer using (as when I switched from WinDirStat to WizTree a few years back), but I prefer to leave Microsoft’s built-in apps alone. Do whatever suits you best.

Practice makes perfect

If you perform such cleanups periodically (I shoot for at least once a month), you’ll be able to keep your space consumption under much better control. Try this regimen out for yourself and you’ll soon see what I mean.

And don’t forget to slog through the Users folder (especially your account subfolder) from time to time, too, because junk too often tends to accumulate there. You can find that folder on your C: drive, where it sits alongside other, well-known top-level folders (e.g., Windows, Program Files, and so forth), as shown in Figure 12.

users folder in windows

Figure 12: The Users folder is at the top of the C: drive hierarchy, along with Windows, Program Files, and so forth.

Ed Tittel / IDG

After all the work is done, you can then blissfully enjoy your clean machine!

This article was originally published in January 2019 and most recently updated in August 2024.