sqlskills-logo-2015-white.png

Windows Disk Cleanup

One very useful tool for freeing up disk space is the built-in Disk Cleanup application in Windows. You can start this application by simply typing Disk Cleanup at your Windows Start menu. Once it starts, you will need to pick which drive you want to scan and clean up. In most cases, you will want to choose your boot drive, which will be C: for most people.


image

Figure 1: Disk Cleanup: Drive Selection Screen


image

Figure 2: Initial Disk Cleanup Screen


You should always click on the “Clean up system files” button to get a complete picture (and find the larger files that you may be able to delete). After clicking on the button, you’ll have to wait for the scan to complete. If you have a magnetic drive, this might take a while, while if you have an Intel Optane 900P drive, it will be extremely quick!


image

Figure 3: Disk Cleanup after clicking on Cleanup system files

In many cases, you will find an entry for “Previous Windows installation(s)” that may be 25-50GB in size, which is pretty significant when you have a smaller boot drive and are running low on disk space. In Windows 10, you will get those when you install the semi-annual updates such as the recent “Windows 10 April 2018” update.

You just need to be aware that if you let Disk Cleanup delete the previous Windows installations, you won’t be able to go back to a previous version by uninstalling the latest version. The tool will display a special confirmation dialog to make sure you know this.

If you choose to delete everything that the tool offers up, it is not uncommon to get 50-75GB of space back. Again, the disk cleanup process will take quite a while with a magnetic drive.

You can start Disk Cleanup from a command line, as Microsoft explains here.


You can also use the Windows Storage Sense feature to automatically do some of the disk cleanup for on all of your drives.


image

Figure 4: Storage Sense Display


image

Figure 5: Storage Sense Configuration

3 thoughts on “Windows Disk Cleanup

  1. We occasionally encounter space issues on our servers and find that much of the usage on c: is in C:\Windows\winsxs. My understanding is that Windows keeps files used for Windows Updates here, and that it is not uncommon for the folder to grow continuously over time.

    We use Disk Cleanup’s “Windows Update Cleanup” for this, but Disk Cleanup is not available on Server 2012 by default. You can obtain it by installing the Desktop Experience feature. More info here: https://www.saotn.org/windows-server-2012-r2-disk-cleanup-dism/

    For Server 2008, Disk Cleanup is available, but KB2852386 is necessary for the Windows Update Cleanup option.

  2. Glenn,

    Do you know if this disk cleanup could be automated as a PowerSHell or batch job on multiple machines to help clean up after patch Tuesdays?

    Thanks,
    BJ

Leave a Reply

Your email address will not be published. Required fields are marked *

Other articles

Imagine feeling confident enough to handle whatever your database throws at you.

With training and consulting from SQLskills, you’ll be able to solve big problems, elevate your team’s capacity, and take control of your data career.