How To Clean Computer Using CMD – [command prompt]

By
Published: 26 Jul 2022
Your PC is running slow? Don’t panic, because we will help you make it fast again!

Time by time as you use your PC, there are tons of files that will accumulate on your hard drive and make it slow. Keeping your computer free from clutter is one of the best ways to improve performance and stability, and by cleaning only the junk files you can free a lot of disk space.

In this guide, we will show you How To Clean Computer Using CMD (command prompt)!

How To Clean Computer Using CMD – [command prompt]

There are two methods that will clean your Windows PC using Command Prompt. These two methods are Defragment hard disk via CMD and Run disk Cleanup Utility via CMD which are pretty simple to do.

1. Defragment Hard Disk via CMD

With this method, you can defrag your hard disk using the CMD on your PC, and it will clean all junk files stored on your disk for a long time.

Step 1. Click on the Windows Start button and type “CMD” in the search bar. Once the Command Prompt appears, right-click on it and select “Run as Administrator”.

Step 2. Once the CMD opens, you have to enter the command: defrag c:

Take note that with this command will defrag the C: Drive on your PC. You can change the drive letter depending if you have more partitions on your hard drive.

Step 3. Once you chose the disk that you want to defrag, the Disk Defragment tool will scan the selected drive and will remove all the junk and temp files on the selected disk partition.

With these 3 steps you are done and you can defragment your PC pretty simple with only a few clicks.

2. Run Disk Cleanup Utility via CMD

Using this method, you can easily access the Disc Cleanup Utility and run the built-in Disk Cleanup to free up storage space. Follow the steps below to clean up your disk successfully.

Step 1. Click on the Windows Start button and type “CMD” on the search bar. Once the Command Prompt appears, right-click on it and select “Run as Administrator”.

Step 2. Once you open the Command Prompt, you need to type “cleanmgr” and press the Enter button.

Step 3. Once you press Enter, it will launch the Disk Cleanup utility, and you have to select the drive that you want to clean. Select the hard drive partition and press “OK”.

If you want to skip the drive selection pop-up, enter the command: “cleanmgr /sageset”

It will start to scan your hard drive for all the junk and temp files on it.

Once the scanning is done, it will open another window where you need to select the files to delete after executing the above command.

Step 4. If you want to delete all the files automatically, then you need to type the next command: “cleanmgr /sagerun”.

With this command, it will automatically scan all the files on your drives and delete junk files from your PC.

That it. It is pretty simple and easy. Now you can go and try to clean your PC and make it run faster.

Latest