How Do I Clean PC Using CMD | 5 Easy Steps in Command Prompt

How Do I Clean PC Using CMD

Microsoft Windows,, commonly referred to like Windows, is one of the most used operating systems designed for business and personal use computers. You will certainly be able to use various features with your PC.

With lots of activities in the background, PC memory must be cleaned now and then. Windows operating system lets you cleanse your PC memory in various ways. It is possible to use third-party software to create temporary files for flashing on HDD, or you can utilize the disk cleanup capabilities built into Windows at your command line.

In this blog, we will discuss How Do Clean PC Using CMD [Command Prompt] (command prompt).

  1. Enter ” cmd” on the windows search bar or start through the dialogue box.
  2. Right-click on the Command Prompt.
  3. Select Run as an administrator.
  4. You will be in the Command Prompt window.

Also Read: 6 Steps to Fix Laptop Makes Noise When Plugged In  

Tip: If you run cmd.exe in the role of an administrator, you will be granted elevated access to your commands. They are executed within the system32 directory and not as the authenticated user.

Going to the cleaning commands, you can use a variety of commands to clean your PC whenever you want to clean your hard memory or disk. If you want to flash any unwanted files, you’ll be able clean these files manually by clearing the temporary folder. It is possible to speed up the cleansing process by using Disk Defragmenter and diskpart along with diskpart and the Disk Cleanup tool by using commands.

There will be instructions to clean different areas of your PC’s memory and the steps required to perform it in this article.

Why Do You Need to Clean PC Using CMD (Command Prompt)?

How Do I Clean PC Using CMD

GUI applications are easy to use. However, using the Windows command processor can be fun and extremely efficient. Suppose you’re one of those who aren’t interested in loading other tools into their computer memory and prefer to use the command prompt to reap its effectiveness and performance advantages. In that case, This guide will cover the entire spectrum.

Cleaning your PC’s memory is just as important as cleaning your hardware. When running programs, your PC produces temporary unneeded files after usage. Although these files are small, the number of files can be a huge Gigabytes and therefore must be cleaned frequently. Clean hardware can help your PC run efficiently and prolong the life of your PC. At the same time, software and memory cleanup protects your programs from being unable to run and possible conflicts and improves memory performance.

Cleaning your disks can help keep your PC in good condition and eliminate the chance of slowing or lagging. With the latest technology, it’s not a big issue; however, flushing out undesirable files off a hard disk is an excellent idea.

Also Read: How to Delete Instagram Messages | Easy Tutorial

The Command Prompt?

Cmd is the default command-line interpreter for operating systems including Windows, Linux, ArcaOS, eComStation, etc. Command Prompts is an interface based on text within your operating system. It allows easy access to any file or directory manually. It can address problems and solve any type of Windows issue. Certain command prompts can also function as disk cleanup management tools.

Cleanse Up the Computer by Using Command Prompt

The next section of this blog post provides a list of commands that you can execute to clean your computer using cmd. Before using these commands, make sure you understand their purpose and only execute them when required.

Clean up unwanted files by using the Cleanmgr command class

How Do I Clean PC Using CMD

This kind of Command lets users eliminate unneeded files and free disk space on the computer’s hard drive. It first looks at the documents on the computer which aren’t in use, then eliminates the files. It also has sub-commands that are devoted to specific tasks.

Also Read: How To Update Apps On Vizio TV? Easy Steps

1.1 Cleanmgr

Cleanmgris a command for cleaning up your disk line that cleans the junk. Follow these steps for using this Command.

  • Cleanmgris a command line for cleaning your disk line to clear the junk.
  • Go to the command prompt, and enter ” Cleanmgr to run it.
  • The window that appears will open in which you need to choose the drive you want to cleanse.
  • Click OKto instruct your system to analyze the drive to find any removable junk.
  • Find the files you wish to erase and then click OK to proceed.

Tutorial: clean computer using cmd – cleanmgr Command

If you’re looking to automate the task of cleaning up your disk, it is possible to use three command-line options to use that Cleanmgraccepts. These are /sageset,/sagerun and /lowdisk.

1.2 Cleanmgr/sageset

This option will skip the disk selection process and direct you onto the Category Selection Menu, where you must determine the kind of trash files you wish to eliminate.

The syntax of this “sageset”command is as follows:

cleanmgr/ sageset: numeric_id 

Examples:

c:\Windows\system32> cleanmgr/ sageset: 1

1.3 Cleanmgr/ sagerun

This Command will perform the disk cleaning process without selecting the categories that you must make use of to use the Sageruncommand.

The format for running an “sagerun”command is:

cleanmgr/ sagerun: id

For example:

c:\Windows\system32> cleanmgr/ sagerun: 1

1.4 Cleanmgr/lowdisk

This command stops the disk drive from operating in low disk space. If this switch is triggered, the disk cleanup is checked with all checkboxes in default. The way to run this Command is the lowdisk command is as follows:

cleanmgr/lowdisk/d

For example:

c:\Windows\system32> cleanmgr/lowdisk/dc c:\Windows\system32> cleanmgr/lowdisk/dd  

Tip The commands work on server 2003 Server 2008, server 2003, Windows XP, Vista, Windows 7, 8 as well as Windows 10.

Also Read: Instagram Saved Posts Aren’t Loading | Fix This Issue in 5 Easy Steps

Clean temporary files by using the cleaning command

How Do I Clean PC Using CMD

Temporary files are known as Temp. They store information for a brief period in an application. Additionally, they can be made to be used for backup purposes. Primarily, they serve to keep, transfer or store data, and retrieve deleted information.

It is secure to erase temporary files. Any software doesn’t utilize only the files. Most of the time, Windows will prevent you from deleting them, but losing them during execution time could cause the task to be unable to run.

The temporary files(Temp) created by OS are stored in %system%/windows/temp while temporary files (%Temp%) created by the users are stored in C:\Users\username\AppData\Local\Temp.

To see temples by using a command prompt, use:

%SystemRoot%\explorer.exe %temp%\

and the Command to remove temporary files (you can delete them from the directory as well):

del %temp%\*. */s/q

Cleanse prefetching files using a command prompt

Windows creates all kinds of files that are temporary on the hard disk. These files are created by your operating system whenever an application is launched the first time, and later, they function as cache. How an application chooses to utilize the designated file could take up lots of space.

Prefetch’s purpose is to make the app more efficient; however, if you’re experiencing app issues or lags, you can remove the files.

To confirm the prefetch file on your computer, simply look at the prefetch folder such as this (on the command line):

%SystemRoot%\explorer.exe C:\Windows\prefetch\

Then remove the files from that prefetch directory;

del C:\Windows\prefetch\*. */s/q

Clear cache memory from windows

Cache files are beneficial for performance; however, when there’s a problem with the cache files, it may result in data fetching issues and glitches. They can also cause crashes. The most commonly used solution is to clear the cache memory periodically over time.

You can remove your DNS cache and Windows cache and store them from your computer without hesitation. If there’s a problem with deleting these cache files, windows will inform you. To flush out the DNS cache, you must start by running the command prompt in administrator mode.

  1. Find a Command prompt in the Windows search bar.
  2. Click on Command Prompt, right-click, and choose the option to run as an administrator.
  3. Then, at the command prompt, execute this command:

ipconfig/flush DNS

You’ll receive a message which informs you that the DNS cache has been flushed successfully.

For you to remove windows cache memory, the user must run this WSResetcommand within the cmd. This will show a black screen similar to the image below. After that, you have to wait until the windows go away to ensure that the memory of the windows is effectively flushed.

Defragment your hard disk using the command prompt

Another aspect of cleaning your computer’s memory is defragmenting the disks.

Defragmenting is the act of rearranging the data on a hard drive. It reduces fragmentation by physically organizing the contents of storage in the least amount of adjacent areas. Rearranging the files allows your computer to access files quicker from the hard drive.

Disk fragmentation is a normal phenomenon on conventional hard drives. However, it is susceptible to the performance of PC. In essence, the fragments impact the speed of writing and accessing your HDD and can cause slow performance on your PC.

To defragment your hard drive using cmd;

  1. Open the command prompt in the role of administrator.
  2. Use defrag drive later’ of the preferred drive: defrag c:

Be aware that the c: in the defrag Command. The c command refers to the drive, i.e. drive you’re trying to defrag. You can change the letter of your drive if you need to defrag a different drive.

Use the Diskpart command to erase all data from HDD.

Diskpartis a command-line utility for partitioning disks. It is accessible for Windows 2000 and later editions. Before, the Fdiskcommand was used to accomplish this job. You can utilize this disk part command line to cleanse your hard drive, using specific switches such as “clean” and “clean the entire” to erase all data from the drive.

Clean hard drive using disk part command, diskpart command follow these steps:

  1. Open the command prompt in the role of administrator.
  2. Enter the diskpart command and hit enter.
  3. Follow the following diskpart type “list disk” in cmd in the following steps.
  4. It will show all disks connected to your computer and their availability status.
  5. The is the of the disk is the select disk, for example, select disk 0
  6. ** If the disk’s status is offline, select ” online disk” and hit enter.
  7. After that, type “clean” and “clean all” by your requirements.
  8. You’ll get the “diskpart has succeeded at cleaning up the disc” message when you have succeeded.

The clean command will only clean the data on HDD, and it will mark the data as deleted. However, cleanse ALL Command will erase every bit of data on the disk, and then you will not be able to retrieve the data.

DISM Windows image cleaning

If you’re having issues with your operating system, you can fix the issue by contacting OS. This is a cleaning of images that restores the operating system’s health to its best condition.

The command line you utilize here is known as DISM(deployment management and servicing of images), which is a built-in command line utilized to manage Windows images (.wim) as well as a virtual hard disk (.vhd). It is also utilized to manage the Windows Recovery Environment and Windows setup process and update the operating system.

To determine if there’s any type of corruption, take the steps below: Begin cmd with admin privileges.

Start cmd with admin privileges and type this Command.

DISM /online/Cleanup-Image/checkhealth

To scan the image of windows, utilize this Command.

Online / DISM /Cleanup-Image/ScanHealth

Clear your computer using cmd – scan health command

To fix the Windows images, if you discover corrupted or damaged files, follow this procedure;

DISM /Online /Cleanup-Image /restorehealth /Source:repairSource\install.wim

It is possible to scan your computer for viruses or malware through the Command Prompt. Windows Defender carries out the scanning process.

Wrapping Up

Command prompts are a very powerful tool that can accomplish a multitude of other tasks on your computer. If you know more regarding PC clean commands, please let us know via the comments below.

Chris Evan was born in Dubai and raised in Montreal. He studied Computer Science and was so pleased with computer languages. He began writing after obsessing over technology.

Leave a Reply

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