How to Clean Computer Using CMD [Command Prompt]

How to Clean Computer Using CMD [Command Prompt]

The Windows operating system has evolved a lot in the recent past and came up with a lot of utilities for PC maintenance. There isn’t any inbuilt PC optimizer that can offer a one-stop solution and hence we need to make use of different utilities for every task. The best method to clean up the PC is through the command prompt utility. When all the apps are closed, it performs a thorough cleanup.

Most users are not aware of how to clean computers using CMD. The user interface is not quite friendly where you see all the buttons and just click on the right one. Here you need to enter commands and syntaxes to perform cleanup on your computer. There are a few major commands that you are going to explore in this article. If you still have a sluggish PC, you will need to make use of the Best Windows Cleaner Tools for Windows.

Access Command Prompt

There are different ways to access the command prompt window. We need to access it with the ‘Run as Administrator’ rights. Follow these commands to get into it.

Step 1. Press the Window key and type CMD in the search bar.

Step 2. On the command prompt app, click on the Run as Administrator option. Confirm and allow permissions to access it as administrator when prompted.

If you ever get stuck with any of the commands or want to confirm the syntax, simply type the command followed by the /? symbol. (Example: cleanmgr /?)

Delete Temp Files using CMD

Temp files occupy a lot of space on your hard drive. Whenever you browse any program or use any application, it creates a lot of junk files and temp files. Here is how to clean Temp Files using CMD.

Step 1. You can type the below command to view all the temp files in Windows Explorer.

%SystemRoot%\explorer.exe %temp%\

Step 2. To delete all the temp files using CMD, type del %temp%\*.* /s /q and hit the Enter key.

Step 3. Once done follow the next command to initiate the Disk Cleanup process.

Step 4. Type del C:\Windows\prefetch\*.*/s/q to clear the prefetch files that are created by the OS while using any apps.

Run Disk Cleanup Using CMD

Disk Cleanup is one of the best cleanup utilities to quickly find and erase all the clutter from your PC. The GUI mode is much easier to perform but you can try these commands to do it using CMD.

Step 1. If you wish to access the Disk Cleanup Utility in GUI mode, you can type cleanmgr and hit the Enter key. It will ask you to select the hard drive partition where we need to select the driver with Windows loaded. It will scan and show up all the removable files. select all and click on the Okay button to delete them. You can skip selecting the drive by using the cleanmgr /sageset command.

Step 2. If you wish to delete all the files automatically, you can type cleanmgr /sagerun and hit the Enter key. It will find and remove all the junk files from your computer.

Step 3. If you are running out of space, you can follow this command to execute for low disk space. You can change the drive letter to C if your C: Drive is running out of space.

cleanmgr /lowdisk /d

Run Disk Defragmentation with CMD

Disk Defragmentation is the next step on how to clean PC using CMD. Deleted files leave unorganized sectors on your hard drive. This command will organize all the fragmented sectors and perform a disk defragmentation.

Step 1. Access command prompt with administrator rights.

Step 2. Type Defrag C: and hit the Enter key to initiate defragmentation on the C: Drive. Once done with the C: Drive, you can perform the same action with other drive letters. It will take some time to finish up the disk defragmentation. Do not close the window until you see the C:\Windows\system32>

Use the Best PC Cleaner for Windows

Alternatively, you can make use of the Best System Optimizer for Windows to perform a complete optimization. There are dozens of PC optimizers for Windows over the web. We have tried, tested, compared, and reviewed the best PC optimizers and listed the ones that worked great in 2022.

Read also:Importance of SEO Services In lahore for business

Advanced System Optimizer is a one-stop solution to keep your system as good as new. It offers advanced cleaning and optimization, securely deletes confidential files, adds encryption to folders, and backup & restore system data. It has all the utilities to clean up the registry, optimize disk, RAM optimizer, game optimizer, and other useful utilities for a complete cleanup.

Summing Up

This article on how to clean a computer using CMD has all the basic commands to perform a quick optimization. You can perform these commands to work like a pro and keep your system clutter-free. If these steps on how to clean a PC using CMD are not helping you enough, you can always make use of the Best PC Optimizer for Windows to ensure that your system remains as good as new throughout the journey. Keep it Clean!


Leave a Reply

Your email address will not be published. Required fields are marked *