Skip to content
NoticeWelcome to Osteup! Practical tools and optimization tweaks shared freely.
Osteup LogoOsteup

Boost PC & Reduce Lag with Automated Windows Batch Script

oosteup
··1 min read·0 views
WindowsFix Lag
Ilustrasi optimasi dan mempercepat PC laptop dengan file BAT otomatis di Windows

Over extended periods of use, Windows 10 and Windows 11 machines accumulate thousands of temporary cache files, broken DNS cache records, and stale software installer logs. This buildup causes sluggish application launch times, unexplained disk clutter on drive C, and micro-stuttering during gaming sessions.

How the BAT Script Works: A .bat (Batch file) is a lightweight script containing pre-written Microsoft Windows Command Prompt (CMD) commands. Rather than manually typing dozens of terminal commands, the script executes the entire disk cleanup, DNS cache flushing, and system maintenance sequence automatically with a single click.

Optimization Modules Included in the Batch Script

All operations rely entirely on native Windows administration binaries, ensuring zero third-party background bloat:

Maintenance Category Primary Commands System Benefit
Temporary Cache Purging del /q /f /s %temp%\*
cleanmgr /sagerun:1
Deletes obsolete Temp, Prefetch, and crash dump files, reclaiming between 3GB and 20GB of disk space.
Network & Socket Reset ipconfig /flushdns
netsh winsock reset
Clears corrupted DNS mappings and resets the network socket layer to eliminate ping spikes and packet drops.
System File Integrity Check sfc /scannow
chkdsk /f (optional)
Scans for corrupted system DLLs and automatically restores healthy copies from the component store.
Drive Cache Optimization fsutil behavior set DisableLastAccess 1 Disables the unnecessary last-access timestamp recording on files, reducing redundant write cycles on SSDs.

Script Source Code Preview

You can open the script with Notepad at any time to inspect the code before execution:

Clean_and_Optimize.batpowershell
@echo offtitle Osteup - Windows Clean & Optimize Scriptecho Cleaning system temporary cache...del /s /f /q %userprofile%\AppData\Local\Temp\*.* >nul 2>&1del /s /f /q C:\Windows\Temp\*.* >nul 2>&1del /s /f /q C:\Windows\Prefetch\*.* >nul 2>&1echo Flushing DNS cache and network sockets...ipconfig /flushdns >nul 2>&1echo Optimizing file system cache behavior...fsutil behavior set DisableLastAccess 1 >nul 2>&1echo System maintenance completed successfully!pause

Step-by-Step Usage Guide

Follow these steps to ensure full execution without "Access Denied" permission errors:

  1. Download the archive from the link below and unpack it using password osteup.
  2. Close all open applications, browser tabs, and background work to allow locked temporary files to be cleaned.
  3. Right-click the .bat file and choose Run as administrator.
  4. A command prompt window will appear and process each cleanup step automatically over 30 to 90 seconds.
  5. Once the finished prompt appears, press any key to close the window and restart your PC to finalize all configuration changes.

Crucial Requirement: You must launch the file as Administrator. Running it via standard double-click will cause Windows to block deletions inside protected directories like C:\Windows\Temp.

Windows 10/11 Optimization & Speed-Up Batch Script
Automated 1-click script to purge disk cache, flush DNS, and restore peak system responsiveness
Format .BAT & .ZIP
File Size ~ 15 KB
Compatibility Windows 10, 11 (32/64-bit)
Password osteup
Extraction Password: osteup

Frequently Asked Questions

Will this batch script delete my personal documents or photos?

No. The script strictly targets temporary directories (AppData\Local\Temp, Windows\Temp, Prefetch) and system cache stores. Your personal files on Desktop, Documents, Downloads, and secondary drives remain completely untouched.

Why does Windows SmartScreen display a prompt when downloading?

Because .bat files contain executable script instructions, web browsers and Windows Defender flag them conservatively. This is a standard false positive. You can right-click the file and click Edit to review every command line in plaintext before running.

How frequently should I execute this optimization script?

Running the maintenance script once every 1 to 2 weeks, or immediately following major Windows cumulative updates, is optimal for keeping cache buildup under control.

Was this article helpful?

Related Articles

Comments(0)

No comments yet. Be the first to join the conversation!