Introduction / Why It's Needed
The cleanmgr (Disk Cleanup) utility is a built-in Windows tool designed for the safe removal of temporary and unnecessary files that accumulate during system and application operation. Regular use of cleanmgr helps:
- Free up space on the system drive, which is especially relevant for drives with small capacity (SSD/HDD).
- Speed up system performance by reducing disk load and the system search index.
- Perform basic diagnostics, as the utility can point to large volumes of data copied to specific folders (e.g.,
Windows.oldafter an update).
This guide is suitable for Windows 10 and Windows 11.
Requirements / Preparation
Before you begin, make sure that:
- You have administrator rights to delete system files (e.g., update files).
- There is enough free space on the system drive (
C:) for the utility to operate (at least 100-200 MB). - Close all running programs, especially those that may actively work with files (browsers, office suites, messengers). This will speed up the process and prevent file lock errors.
Step-by-Step Guide
Step 1: Launching the cleanmgr utility
The simplest way is through the Windows search:
- Press
Win + Sand start typing "Disk Cleanup". - In the search results, select the "Disk Cleanup" application.
Alternative methods:
- Press
Win + R, typecleanmgr, and press Enter. - Open Control Panel → System and Security → Disk Cleanup.
💡 Tip: To access the extended list of files (including "Windows Update Services"), always run cleanmgr as an administrator. You can do this by right-clicking on the found application and selecting "Run as administrator".
Step 2: Selecting a drive and analysis
- In the utility's first window, select the drive you want to clean (usually
C:— the system drive) and click OK. - The scanning process will begin. The utility will calculate how much space can be freed by deleting each file type. This can take from a few seconds to several minutes.
Example: Disk selection window for cleanup
Step 3: Selecting files to delete
After the analysis, you will see a list of file categories with checkboxes and size indicators:
- Temporary files — standard temporary application data.
- Windows Update Cleanup — files left after installing updates (often gigabytes in size).
- Temporary Internet Files — browser cache (if they use the system's shared cache).
- Recycle Bin — files already deleted by the user but not yet emptied.
- Paging files — temporary memory files (cleaned only when the PC is shut down if this option is enabled).
- OS upgrade files — temporary system update files.
- Error reporting — Windows error logs.
- Temporary files saved by programs and others.
Selection recommendations:
- You can safely check all categories if you do not plan to roll back updates or restore specific deleted files.
- Special attention: before deleting the
Windows.oldcategory (if present), make sure you do not plan to roll back to a previous version of Windows. This directory can occupy 15-30 GB. - To view the full list (including hidden system files), click the "Clean up system files" button. Administrator rights are required.
⚠️ Important: If you are unsure about the purpose of a category, click on it and view the description at the bottom of the window. Deleting some file types (e.g., "OS boot files") may make it impossible to roll back installed updates.
Step 4: Confirmation and performing the cleanup
- Check the desired categories.
- Click OK.
- In the warning that appears, click "Delete Files".
- The deletion process will begin. Do not close the window or interrupt the process.
Step 5: Checking the result
After completion, cleanmgr will show a dialog box with a report: "Disk Cleanup is complete. Freed up: X GB."
For manual verification:
- Open File Explorer (
Win + E). - Right-click on the system drive (
C:) and select "Properties". - The "General" tab will show how much space is free and used. Compare with previous values.
Potential Issues
Issue 1: Missing drive or file category
- Cause: The utility may not show data on drives that are not system drives, or categories if the corresponding Windows components are not installed (e.g., old updates).
- Solution: To clean a non-system drive, run cleanmgr specifying the path:
cleanmgr /d D:(whereD:is the required drive letter). To access system files (Windows updates), ensure the utility is run as an administrator.
Issue 2: Access Denied error during deletion
- Cause: Some files are locked by the system or running programs (e.g., files in
C:\Windows\Tempmay be open to system processes). - Solution:
- Close all applications, especially browsers and office programs.
- Run cleanmgr as an administrator.
- If the error persists, restart the computer and try again—many temporary files will be unlocked at system startup.
Issue 3: Cleanup takes too long
- Cause: A large volume of data to analyze (hundreds of thousands of files) or a slow hard disk (HDD).
- Solution: You can interrupt the process by clicking Cancel. Freed space will be partial. To speed it up in the future:
- Configure automatic cleanmgr startup via Task Scheduler (e.g., once a month).
- Use faster alternatives for routine cleanup (e.g., the built-in "Disk Cleanup" via drive properties, which uses the same engine but with a simplified interface).
Issue 4: Space is not freed after cleanup
- Cause: Most often, this happens because files that were actively used by the system or programs at the time cleanmgr was launched were cleaned (e.g., browser cache of an open browser during cleanup).
- Solution: Close all programs and run cleanmgr again. Also, check if files were automatically restored (e.g., some programs recreate cache on next launch). In this case, cleanup should be performed with all applications completely closed.