RackNerd Billboard Banner

How to Clean Your Windows PC Using Command Prompt

When your Windows PC starts slowing down, most people reach for third-party cleaners. But did you know you can tidy up your system right from the Command Prompt? No downloads. No bloatware. Just built-in tools. Here’s how to clean your PC using CMD like a pro.


⚠️ First: Run CMD as Administrator

Before anything, make sure you open Command Prompt with admin rights.

  • Press Win + S, type cmd
  • Right-click Command Prompt > Run as administrator

1. Delete Temporary Files

Temporary files pile up and hog space. Use this to wipe them out:

del /q /f /s %TEMP%\*

You can also clear system-wide temp files:

del /q /f /s C:\Windows\Temp\*

Tip: Windows might block some in-use files—just skip those.


2. Clear the DNS Cache

If you’ve got slow or glitchy browsing, this might help:

ipconfig /flushdns

You’ll get a “Successfully flushed…” message when done.


3. Clean Up the Component Store (WinSxS)

This frees up space taken by Windows updates and old components:

dism /Online /Cleanup-Image /StartComponentCleanup

Optional deep clean:

dism /Online /Cleanup-Image /SPSuperseded

Use this only if you don’t plan to uninstall updates.


4. Run Disk Cleanup via CMD

Windows’ built-in Disk Cleanup tool can be triggered like this:

cleanmgr /sageset:1
cleanmgr /sagerun:1

You’ll first select what to clean, then the tool will run with those settings.


5. Check for System File Corruption

Corrupted system files can slow things down. Fix them like this:

sfc /scannow

This will scan and repair system files automatically.


6. Optional: Stop Unnecessary Startup Services

To list all startup services:

wmic startup get caption, command

To disable something specific, you’ll need to use Task Manager or System Configuration (msconfig)—CMD can show info, but not disable items directly.


Final Thoughts

Command Prompt isn’t flashy, but it’s powerful. Using these commands, you can clean up junk, speed up your machine, and solve problems—without installing anything extra. Make CMD part of your regular maintenance routine, and your PC will thank you.


Want more power-user tips like this? Hit subscribe or drop a comment below.

0 0 votes
Article Rating
Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments
RackNerd Billboard Banner
0
Would love your thoughts, please comment.x
()
x
Copy link