The Windows Disk Cleanup Utility, known as cleanmgr.exe, is a powerful tool that helps you remove unnecessary files from your Windows Server’s hard disk. By regularly running disk cleanup, you can reclaim disk space, prevent excessive disk consumption, and improve server performance. This article will guide you through the process of running disk cleanup on Windows Server 2016 and 2012.
Why Run Disk Cleanup?
Running disk cleanup is crucial for maintaining optimal server performance. Accumulated unnecessary files can consume valuable disk space and potentially slow down your server. By removing these files, you can free up storage capacity and enhance the overall efficiency of your Windows Server.
Method 1 – By using GUI.
1. To start off log in to your Windows Server then search and open File Explorer
2. Then click This PC on the left-hand side and right-click a drive, then click Properties.
3. Next, click on Disk Cleanup.
4. Now, the system will calculate the unwanted files according to their type.
5. You will now have files that you can select to delete to clean up the disk, once you have selected the files you want to delete click OK.
6. Next, you will be prompted to confirm that you want to permanently delete these files once you are sure click Delete Files.
7. Now the system will begin cleaning up the drive.
Method 2 – By using CMD.
1. To start, log in to your Windows server then, search CMD and run as Administrator by right-clicking it.
2. Next, type cleanmgr.exe into the command prompt then hit Enter.
3. Now, the system will calculate the files according to their types.
If you have more than one drive on your server, then you will be prompted to select a specific drive to start the disk cleanup utility.
4. You will now have files that you can select to delete to clean up the disk, once you have selected the files you want to delete click OK.
5. Next, you will be prompted to confirm that you want to permanently delete these files once you are sure click Delete Files.
6. Now the system will begin cleaning up the drive.
cleanmgr.exe also has various variables which you can specify while running it using the command prompt (CMD),
cleanmgr.exe [/d driveletter] [/SAGESET:n | /SAGERUN:n | TUNEUP:n | /LOWDISK | /VERYLOWDISK | /SETUP | /AUTOCLEAN]
/AUTOCLEAN: This variable removes all the old files which are left from recent windows updates.
/LOWDISK: This variable guide you through the GUI interface to remove the unwanted files from the server.
/SETUP: This variable removes all the files which are left from recent windows.
If you are running too low on disk and want to remove unwanted files, then run the following command,
cleanmgr with /VERYLOWDISK variable won’t prompt you to select specific file types; Windows will start removing unwanted files.