Creating a batch file to optimize Windows 11 is a great way to handle routine maintenance in one click. Below is a script that focuses on cleaning temporary files, repairing system corruption, and resetting high-CPU processes.

πŸ› οΈ Optimization Batch Script
Copy the code below into Notepad, then save the file with a .bat extension (e.g., Optimize.bat).
[!IMPORTANT]
You must right-click the file and select “Run as Administrator” for these commands to work.

@echo off
title Windows 11 Optimization Script
echo Preparing to optimize your system…
echo —————————————–

:: 1. Clean Temporary Files
echo Cleaning system and user temporary files…
del /q /f /s %temp%\*
del /q /f /s C:\Windows\Temp\*
del /q /f /s C:\Windows\Prefetch\*
echo Done.

:: 2. Flush DNS Cache (Fixes network-related CPU spikes)
echo Flushing DNS Cache…
ipconfig /flushdns
echo Done.

:: 3. System File Check & Repair
echo Running Deployment Image Servicing and Management (DISM)…
dism /online /cleanup-image /restorehealth
echo Running System File Checker (SFC)…
sfc /scannow
echo Done.

:: 4. Restart Explorer (Refreshes Shell and reduces UI lag)
echo Restarting Windows Explorer…
taskkill /f /im explorer.exe
start explorer.exe
echo Done.

:: 5. Set Power Scheme to High Performance
echo Setting Power Scheme to High Performance…
powercfg /setactive 8c5e7fda-e8bf-4a96-9a85-a6e23a8c635c
echo Done.

echo —————————————–
echo Optimization Complete! Please restart your PC for best results.
pause

πŸ” Understanding the CPU Impact
High CPU usage in Windows 11 is often caused by specific background services. While the batch script helps, you should also check these three common culprits:
SysMain (formerly Superfetch): This service preloads apps into memory. If you use an SSD, it can sometimes cause unnecessary CPU cycles.
Windows Search Indexer: If your CPU stays high for hours, it might be indexing files.
Startup Apps: Overloaded startup folders are the #1 cause of “slow boots.”
πŸš€ Manual Quick Wins
If the batch file doesn’t lower your usage enough, try these settings:
Disable Startup Apps: Press Ctrl + Shift + Esc, go to the Startup apps tab, and disable everything you don’t need immediately.
Transparency Effects: Go to Settings > Personalization > Colors and turn off Transparency effects. This reduces the load on the Desktop Window Manager (dwm.exe).
Game Mode: Ensure Game Mode is toggled ON in Settings. It prioritizes system resources for the foreground task.

Facebook
Pinterest
Twitter
LinkedIn

Leave a Reply

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

Inquiry

Terms and Conditions (On Call - Non Comprehensive)
Repair Policy
Repair estimate of the parts are suspected, in case during repair if we find some other problems will be
treated as a new problem, we will intimate the same then processed.
Physical verification of the material is only possible when it reaches to our workshop.
All Software's and Data are of customer responsibility; please backup all the data before submitting for
repair.
All repairs of Laptop/Desktop/Printer/Monitor are warranted for 10 days from date of Closed Call.
This warranty applies only to those items which were found defective and repaired, it does not apply to
products in which no defect was found and returned as is or merely recalibrated. Out of warranty
products may not be capable of being returned to the exact original specifications or dimensions.
In case of repeat issue/problem we can only be able to give service on address provided at the time of
call logged,
In no everit will we be liable for any loss or damage including, without limitation, indirect or
consequential loss or damage, or any loss or damages whatsoever arising from use of parts or loss of use
of, data or profits arising out of, or in connection with.
All on-site services and response times are subject to the following conditions:
1. Performed during Standard Business Hours
2. Availability of the services in your area, and the availability of technicians in your area.
3. Availability of parts
Replacement Policy:
No advance replacement will be issued unless the faulty is returned.
Computer Parts are likely to come from a different manufacturer and/or store, For any hardware defects
you will have to
deal with the appropriate manufacturer company
If you want, on behalf of you we will provide the replacement service (pick n drop) on chargeable basis
as per
manufacturer terms.
Payment Terms: Diagnosis fees at the time of Pick-up, remaining at the time of delivery or completion of
work. No credit is available