Keeping your computer free from clutter is one of the ways to improve performance and stability. By just cleaning up the junk files, you can free up tons of disk space. Additionally, Windows 10 & 11 offer several built-in system junk cleaning utilities to free up storage space. Although it’s pretty easy to access those tools, wouldn’t it be easier to access the hidden tools via CMD? Also read: How to Reset Windows 10/11 via CMD (Command Prompt)
Clean Your Windows PC using Command Prompt
In this article, we will share some of the best methods to clean your Windows PC via Command Prompt. The methods shared below are very easy to follow. So, let’s check out.
1. Defragment Hard Disk via CMD
In this method, we will defrag our hard disk via CMD. This method will clean all junk files stored on selected drives. Let’s check out.
First of all, click on the Windows Start button and type in ‘CMD‘. Next, right-click on the Command Promot and select Run as Administrator.
On the Command Prompt, enter the command: defrag c:
Important: The above command will defrag the C: Drive of your PC. Change the drive letter if you want to defrag any other drive. 3. Now, the Disk Defragment tool will scan the selected drive and will remove the junk & temp files.
That’s it! You are done. This is how you can run the Disk Defragment tool via CMD.
2. Run Disk Cleanup Utility via CMD
In this method, we will run the built-in Disk Cleanup utility of Windows 10 to free up storage space. Follow some of the simple steps given below.
First of all, click on the Windows Start button and type in ‘CMD‘. Next, right-click on the Command Promot and select Run as Administrator.
Now, on the Command Prompt, type in cleanmgr and hit the Enter button.
This will launch the Disk Cleanup utility. Select the drive you want to clean and click on the ‘Ok‘ button.
If you wish to skip the drive selection pop-up, enter the command: cleanmgr /sageset
You need to select the files to delete after executing the above command 5. If you wish to delete files automatically, then execute the command: cleanmgr /sagerun
The above command will automatically scan your drives and delete junk files from your PC. So, this guide is all about how to clean your Windows 10/11 PC via Command Prompt. I hope this article helped you! Please share it with your friends also. If you have any doubts about this, let us know in the comment box below.