When the computer is running slowly, and there is insufficient disk space, how can you clean the computer using Command Prompt to speed up the computer and obtain better performance? Dive into learning!
Key Notes:
💡Command Prompt can clear unwanted files, temporary files, prefetch files, cache, and defragment your hard drive.
💡The Command Prompt is a bit difficult for beginners; please read the following guides carefully to avoid data loss. You can also turn to EaseUS Partition Master Free Edition. This tool can defrag your hard drive, clean your PC cache, and analyze your disk as an easier-to-use alternative to Command Prompt.
Cleaning up your PC helps improve performance and free up lots of storage space. However, how to use CMD to speed up your PCs? You can follow this article to learn exactly how to clean up PC using CMD.
Windows has several built-in system cleaning utilities, just like the Disk Cleanup tool. However, the Command Prompt is a lesser-known way to clean up your computer.
Command Prompt is a built-in command processor compatible with Windows 11 and Windows 10/8/7/XP/Vista. Although it requires entering the command line, it has efficiency and performance advantages for Advanced users.
If you don't know how to run commands to clean Windows 11, Windows 10/8/7 PCs, follow the given guide to clean your computer, which can remove unnecessary files, temporary and prefetched files, cached data, and damage to the hard drive Defragment drives, wipe disks, etc.
Here are a few ways to clean up your calculator and speed up Windows performance using Command Prompt. If these Guides are useful to you, don't forget to share this article to help more people.
We will show you how to use different commands in CMD to clean different files. First, you need to open the command prompt with administrator rights.
To do this, follow the instructions:
Disk Cleanup is a built-in Windows utility that searches and analyzes your hard drive and helps you free up space on your computer's hard drive. It can clean downloads, temporary files, Recycle Bin, and even system files.
Guide 1. Delete Basic Files
First, let's learn how to use CMD
to start Disk Cleanup and delete essential files. You can start the disk cleaning tool through the command prompt using the cleanmgr command. Here are the steps:
Step 1: Open a command prompt, type cleanmgr, and press Enter.
Step 2: In the Drive Selection interface, select the drive you want to clean and click OK.
Step 3: In Disk Cleanup, select all the files you want to delete and click OK. Click Delete Files to confirm the action.
Guide 2. Clean Specific Drive
You can run the disk cleanup tool against a drive by typing the cleanmgr command followed by the drive letter. This can be useful to free up space on a specific drive. For example, you can run the following command to clean up the C drive:
cleanmgr /D C
The Disk Cleanup will scan and display all files on your C drive that you can delete. Select them and click OK to remove these files.
Guide 3. Configure the Disk Cleanup Settings
The disk cleanup command provides several parameters dedicated to specific functions. You can customize Disk Cleanup tool settings.
This skips drive selection and redirects you to the Disk Cleanup Settings window to select the items you want Disk Cleanup to clean automatically during its scheduled run time.
This command will automate the disk cleanup process without selecting a category.
You can use this command when the disk drive is low on space. Disk Cleanup will open with all checkboxes selected by default.
Windows creates temporary files for temporary use. They do not take up much disk space and play an important role in the smooth operation of the system. If you must clean your temporary folders frequently, you can do this using Command Prompt.
The storage path for temporary files created by the Windows operating system is %system%/windows/temp. Temporary files created by users are stored in C:\Users\username\AppData\Local\Temp.
Run this command – %SystemRoot%\explorer.exe %temp%\ to open the Temp folder in File Explorer. Then, press Ctrl + A to select all files and delete them. Or run the command – del %temp%\*.* /s /q to delete these temporary files. CMD can automatically skip any files currently in use but delete the remaining temporary files.
How to remove temp files using Command Prompt? In this part, you are sure to have found the step-by-step guide on it. Please share this article and let more users know about it.
Prefetch files are temporary files created when an application runs on Windows. These files contain information used to optimize program execution, such as the number of times the software was run, the run time, and associated files used by the software.
Like other temporary files, prefetch files usually don't take up much space on your hard drive. If you must clean up Windows 10 or Windows 11 prefetch files, please follow the steps below:
Step 1: Open Command Prompt in Windows with administrator rights.
Step 2: Enter %SystemRoot%\explorer.exe C:\Windows\prefetch\ in the command prompt window and press Enter. This will open the Prefetch folder in File Explorer.
Step 3: You can delete the Prefetch folder directly from Windows Explorer. Alternatively, you can also delete it in the CMD window.
Enter del C:\Windows\prefetch\*.*/s/q and press Enter to delete these prefetch files.
An effective way to clean up your computer using CMD is to defragment the disk. While fragmentation on a hard drive occurs naturally, it can cause PC performance issues, such as slower access and write speeds, or slow down the system. Here, we'll show you how to defrag the hard drive using CMD:
Step 1: Launch the Command Prompt as administrator.
Step 2: Type defrag c: in the CMD window and press Enter. Here, replace c: with the target drive letter.
The commands only work for HDDS. If you are using an SSD, turn to a reliable SSD optimizer to boost its performance.
Caching files can significantly improve performance, availability, and scalability and can result in the ability to serve data quickly and faster response times. However, if there are errors in the cached files, data retrieval issues or even crashes may occur. You can prevent or resolve this problem by clearing cache files regularly.
EaseUS Partition Master is also a reliable free PC cache cleaner; you can install it on your PC as an alternative to Command Prompt if you are unfamiliar with the command lines.
If you want to erase the entire disk, you can launch diskpart by using CMD. Diskpart is a command-line disk utility compatible with Windows 2000 and later Windows versions. Its predecessor was fdisk. Diskpart commands can manage your disks and partitions by creating, deleting, and erasing entire disks.
Before wiping the whole disk using CMD, remember to back up the important data.
Here is how to use Command Prompt to clean your hard drive and wipe the whole disk:
Step 1: In the CMD window, type diskpart and press Enter key to continue.
Step 2: Type list disk and press Enter; this will display all the hard drives installed on your computer.
Step 3: Enter select disk n. n represents the disk number.
Note: If you see the disk status showing offline, type online disk and press Enter.
Step 4: To wipe the hard drive, type clean all or clean and press Enter.
During this process, you may meet the "there are no fixed disks to show in Diskpart" error; click the link to learn the fixes.
Command Prompt allows you to use different commands to clean different junk files on your computer. However, not all users can easily use this tool. There are different files to clean. CMD requires familiarity with all the above commands, which is too difficult for beginners. Hence, we recommend that beginners use EaseUS Partition Master to clean their PCs.
In order to avoid data loss caused by entering wrong commands and simplify the computer cleaning process, we recommend you use EaseUS Partition Master, which is a disk and computer space optimization manager for Windows 11/10/18/8.1/7/XP computers.
It can replace CMD to clean disks and computers in the following aspects:
If you run CMD to clean your computer, you will need to have a clear understanding of many commands and be familiar with Command Prompt. However, EaseUS Partition Master allows you to completely clean all junk files on Windows without entering complicated commands.
Don't miss this tool if you want to make computer cleaning easier and simpler.
We hope you can have a smooth computer by following the above solutions. If you have further questions, please continue reading.
1. How to start Disk Cleanup by using the command line?
To start the Disk Cleanup and specify the hard disk to be cleaned by using the command lines, follow these steps:
2. How do I clean up my computer using cmd?
To use CMD to speed up the computer: Open Command Prompt with admin privileges via typing cmd in the Windows search box, right-click the Command Prompt, and select the RunRun as administrator option. Type cleanmgr, and hit Enter. In the Drive Selection window, select the drive you want to clean and click OK.
3. How can I speed up my computer using cmd?
To speed up your computer using CMD, follow the instructions:
4. What is the clean command in cmd?
Clean is the command line to erase the whole disk and make the the disk as new as before.Cleaning or erasing a storage device removes all data and partitions from the drive.
Related Articles
How to Backup Thunderbird Emails to External Hard Drive [Three Ways]
How to Fix "Mac Documents Folder is Empty" Error
[PS4 USB Format] How to Format USB for PS4
How to Fix Mac Keeps Crashing [macOS Ventura/Monterey/Big Sur]