Skip to content

Instantly share code, notes, and snippets.

@rzrabbi
Created March 5, 2023 02:56
Show Gist options
  • Save rzrabbi/bfcf5c28419772b64723619c6228125f to your computer and use it in GitHub Desktop.
Save rzrabbi/bfcf5c28419772b64723619c6228125f to your computer and use it in GitHub Desktop.
Save this script as a .bat file and run it
@echo off
echo Deleting temporary files...
del /q /s %TEMP%\*.*
echo Temporary files deleted.
echo Deleting prefetch files...
del /q /s %SystemRoot%\Prefetch\*.*
echo Prefetch files deleted.
echo Clearing DNS cache...
ipconfig /flushdns
echo DNS cache cleared.
echo Clearing Windows event logs...
wevtutil.exe cl Application
wevtutil.exe cl System
echo Event logs cleared.
echo Clearing browser cache and history...
rundll32.exe InetCpl.cpl,ClearMyTracksByProcess 255
echo Browser cache and history cleared.
echo Cleaning up disk...
cleanmgr.exe /sagerun:1
echo Disk cleanup completed.
echo Done.
pause
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment