Windows: "Clean" The Computer Through The Command Line To Run In The CMD Console.

10 Sept 2023

Originally Posted: Publish0x

While I was writing my previous article "⚠ ⚠ Hackers + Malware + Windows = Cryptocurrency Mining ⚠ ⚠", I thought about adding a command line at the end to run in the Windows CMD console (I don't know if anyone still uses it πŸ˜€πŸ˜€πŸ˜€) , to "clean" the computers with this operating system a little. I admit that I later forgot it, that's why today, in payment of that debt to myself (and of course to you), I decided to write this short article.

It happens that nowadays, computers store a large amount of data, such as files, programs, images and videos, which can cause storage space to run out and/or unwanted files accumulate, which can slow down the performance of the computer. The other big problem is the number of hidden files and files that Windows has where viruses, malware, harmful scripts, etc. are generally hosted.

It is true that to free up space on the computer, unhide files and repair the computer there are various tools and methods, but personally, I consider it more satisfying to do things by yourself because in one way or another it helps us to better understand the systems with those of us who work. The command line that I propose will perform the following operations:

βœ” Close Windows Explorer (function: taskkill), so you will only see the console working.

βœ” Free up space in operational memory.

βœ” Remove the "hidden" attribute from all folders and files on your computer on all drives (this takes a while).

βœ” Delete unnecessary folders and files (bak, autorun, shs, gid, chk, temp, tmp).

βœ” Defragments all computer drives.

βœ” When finished, open Windows Explorer

The steps: The first thing you should do is copy the code into any simple text editor (it can be done from Notepad itself), then save it with the name you want (Example: CleanPC.txt), change the file extension. txt that you created with .bat, CleanPC.bat would remain (the icon changes to a command prompt). Finally, right clic on the file, go to "Run as Administrator", press Enter and wait patiently (very patiently πŸ˜€) for the script to complete.

Note: If you want to interrupt the process before it finishes, close the command window, press Ctrl + Shift + Esc keys, the "Task Manager" will open, clic "File", clic "Run New Task", A window will open, type: explorer and accept or execute Enter.

taskkill /im explorer.exe /f
@color f9
@mode con cols=140 lines=25
@prompt $h
@title "Clean PC by CryptoEntrepreneurs"
@echo off
@set LBRAM=0
@set cont=0
@set fin=0
@echo MYSTRING = (80000000)>Memory.vbe
@start Memory.vbe
echo Releasing Working Memory
echo %sub% Percent Complete
set sub=0
echo Releasing Memory operativa
echo %cont% Percent Complete
@set/a LBRAM="%LBRAM% + 1"
@set/a cont="%LBRAM% / 10"
@if "%LBRAM%"=="1000" goto :B
@goto a
@if exist Memory.vbe del/f/q Memory.vbe
@set cont=0
reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" /v "Hidden" /t REG_DWORD /d "0x0" /f
reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" /v "HideFileExt" /t REG_DWORD /d "0x0" /f
reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" /v "SuperHidden" /t REG_DWORD /d "0x1" /f
reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" /v "ShowSuperHidden" /t REG_DWORD /d "0x0" /f
@for %%F in (C D E F G H I J K L M N O P Q R S T U V W X Y Z) do @if exist %%F:\ attrib -r -a -s -h %%F:\*.* /s /d
@for %%F in (C D E F G H I J K L M N O P Q R S T U V W X Y Z) do @if exist %%F:\ del %%F:\*.bak; autorun.*; *.shs; *.gid; *.chk; *.temp; *.tmp /f /s /q
@if exist "%UserProfile%\AppData\Local\Microsoft\Photo Acquisition" del "%UserProfile%\AppData\Local\Microsoft\Photo Acquisition\*" /f /s /q
@if exist "%TEMP%\*.*" del /f/s/q "%TEMP%\*.*"
@if exist "%UserProfile%\Recent" del "%UserProfile%\Recent\*" /f /s /q
@if exist "%SystemRoot%\TEMP" del "%SystemRoot%\TEMP\*" /f /s /q
@if exist "%SystemRoot%\Prefetch" del "%SystemRoot%\Prefetch\*" /f /s /q
@if exist "%SystemRoot%\system32\wbem\Logs\*.*" del "%SystemRoot%\system32\wbem\Logs\*.*" /f/s/q
@if exist "%SystemRoot%\Debug\UserMode\*.*" del "%SystemRoot%\Debug\UserMode\*.*" /f/s/q
@if exist "%UserProfile%\AppData\Roaming\Microsoft\PowerPoint" del "%UserProfile%\AppData\Roaming\Microsoft\PowerPoint\*" /f /s /q
@if exist "%UserProfile%\AppData\Roaming\Microsoft\Windows\Recent" del "%UserProfile%\AppData\Roaming\Microsoft\Windows\Recent\*" /f /s /q
@if exist "%UserProfile%\AppData\Local\Temp" del "%UserProfile%\AppData\Local\Temp\*" /f /s /q
@if exist "%UserProfile%\Datos de programa\Microsoft\Office\Reciente" del "%UserProfile%\Datos de programa\Microsoft\Office\Reciente\*" /f /s /q
@if exist "%UserProfile%\Config~1\Temp" del "%UserProfile%\Config~1\Temp\*" /f /s /q
@if exist "%UserProfile%\Config~1\Archivos temporales de Internet" del "%UserProfile%\Config~1\Archivos temporales de Internet\*" /f /s /q
@if exist "%UserProfile%\AppData\Local\Microsoft\Windows\Explorer" del "%UserProfile%\AppData\Local\Microsoft\Windows\Explorer\*.*" /f /s /q
@for %%F in (C D E F G H I J K L M N O P Q R S T U V W X Y Z) do @if exist %%F:\$RECYCLE.BIN del %%F:\$RECYCLE.BIN\* /f /s /q
@if exist "%UserProfile%\Recent" rd "%UserProfile%\Recent" /s /q
@if exist "%SystemRoot%\TEMP" rd "%SystemRoot%\TEMP" /s /q
@if exist "%UserProfile%\AppData\Roaming\Microsoft\PowerPoint" rd "%UserProfile%\AppData\Roaming\Microsoft\PowerPoint" /s /q
@if exist "%UserProfile%\AppData\Roaming\Microsoft\Windows\Recent" rd "%UserProfile%\AppData\Roaming\Microsoft\Windows\Recent" /s /q
@if exist "%UserProfile%\AppData\Local\Temp" rd "%UserProfile%\AppData\Local\Temp" /s /q
@if exist "%UserProfile%\Datos de programa\Microsoft\Office\Reciente" rd "%UserProfile%\Datos de programa\Microsoft\Office\Reciente" /s /q
@if exist "%UserProfile%\Config~1\Temp" rd "%UserProfile%\Config~1\Temp" /s /q
@if exist "%UserProfile%\Config~1\Archivos temporales de Internet" rd "%UserProfile%\Config~1\Archivos temporales de Internet" /s /q
@if exist "%UserProfile%\Entorno de red" rd "%UserProfile%\Entorno de red" /s /q
@for %%F in (C D E F G H I J K L M N O P Q R S T U V W X Y Z) do @if exist %%F:\$RECYCLE.BIN rd %%F:\$RECYCLE.BIN /s /q
start explorer.exe

I hope you find it useful. I would appreciate it if you could "give me" your ideas on the subject, modifications, improvements and/or links to your articles.

"To invest you don't have to be a millionaire, but to become a millionaire, you have to invest". - Anonymous.


Earn active and passive earnings (using referral programs). However, I recommend that you do your own research.

πŸ’² QuantFury (JRRU2593) - Trading - Join using my invite code: JRRU2593 and we will both receive a free share like AAPL or UBER, or crypto like BTC or ETH (up to $250). Trade and invest with no commissions or borrowing fees at real-time spot prices from the NYSE, Nasdaq, CME, Bats, Binance and Coinbase exchanges. With a good marketing management you have the possibility of obtaining passive profits without operating in the market.

πŸ’² StormGain - Trading - They can start without investment, capital is acquired for free with the Bitcoin Cloud Miner

πŸ’² BingX - Trading - Called "The People's Exchange", it places a strong emphasis on social trading and offers its clients extensive features: new user rewards, demo account, high leverage, spot trading, standard and perpetual futures, grid trading, copy feed , etc.

πŸ’² BulbPublish0x - Earn daily Crypto, NTFs or Money for reading or writing articles and interacting with publications.

πŸ’² AddmeFast - Earn daily Crypto. Promote and increase the sources of traffic, visibility, reach and reputation of your social networks.

πŸ’² Bitrefill - Living with crypto, a philosophy of financial freedom. Travel, play, eat and live with BTC.

🎁 Undress AI - It's obvious, right?

🎁 GamesHoroscope, Dating, Sweepstakes, Health, Video, DownloadOthersSpecial - mVAS (+18).

πŸ’–Donate To The AuthorπŸ’–

Write & Read to Earn with BULB

Learn More

Enjoy this blog? Subscribe to CryptoEntrepreneurs


Cleaning up your computer through the command line in the CMD console can be a powerful way to optimize your Windows system. With a few simple commands, you can remove temporary files, uninstall unwanted programs, and perform various maintenance tasks. It's a great way to keep your computer running smoothly and efficiently. Just make sure to research and use the right commands carefully to avoid any unintended consequences."
A CMD file consists of a script containing one or multiple commands in the form of plain text that are run in order to execute various tasks. It is similar to a BAT file, which is also generally used to store a batch of executable commands. The CMD files are widely used in the Microsoft Windows operating system.
Cleaning your computer through the command line is like giving it a digital spa day. It's remarkable how a few simple commands can make your system feel rejuvenated. With a clean command-line sweep, you bid adieu to clutter and unnecessary files, ensuring your Windows PC runs smoother and faster.
Some console commands here to look into
The CMD console isn't used as GUI takes a lot of the functions it does but there are still some functions you can't find except on the CMD console
Very interesting, thanks
Very interesting article thanks
I'm really not a fan of windows these days more of linux guy cause of it broadened my mind