How to Run Disk Cleanup Utility via CMD on Windows (Step-by-Step Guide)

 Is your Windows PC running low on storage or performing slower than usual? One of the easiest ways to clean up unnecessary files and free up disk space is by using the Disk Cleanup utility. In this guide, you’ll learn how to run Disk Cleanup via Command Prompt (CMD) with simple commands.


Whether you're a tech enthusiast or a beginner, these steps will help you quickly remove temporary files, system cache, and other junk from your computer.



🔹---


Step 1: Open Command Prompt as Administrator


Click the Windows Start button.


Type CMD in the search box.


Right-click on Command Prompt and select “Run as Administrator.”



This ensures you have the necessary permissions to run system-level tasks.



---


Step 2: Launch Disk Cleanup Utility


To open the Disk Cleanup tool, type the following command and press Enter:


cleanmgr


A pop-up will appear asking you to select a drive (usually C:). Choose the desired drive and click OK.



---


Step 3: Skip Drive Selection (Optional)


If you want to bypass the drive selection dialog and customize cleanup options, use this command:


cleanmgr /sageset:1


This opens a window where you can choose what file types to delete (e.g., Temporary files, Recycle Bin, Thumbnails). Once selected, click OK.



---


Step 4: Run Automatic Disk Cleanup


After setting up the cleanup options, run the automatic cleanup using:


cleanmgr /sagerun:1


This will scan your drives and automatically delete the selected file types without asking you again.



---


Bonus Tip: Automate with Task Scheduler


You can even schedule this command with Windows Task Scheduler to run weekly or monthly for hands-free PC maintenance.



---


Conclusion


Using Command Prompt to run the Disk Cleanup utility is a quick and powerful way to keep your Windows system optimized. It's especially helpful for advanced users, IT administrators, or anyone managing multiple PCs.

---

Popular posts from this blog

🌀 SMURF ATTACK 🌀

🔥How to Create a Malicious PDF Using Metasploit for Ethical Hacking Practice❓

What is REST? A Comprehensive Guide for Software Developers