Create a batch file to clear recent file usage history, media usage history, and recently used program traces in Windows 10 and 11 with a single click. This script will do the following: 1. Delete recent files and jump list history 2.Clear Explorer Run history 3.Clear Quick Access history 4. Delete temporary files 5.Clear prefetch files and 6. Provide a prompt after each operation
How to use the script: Copy and paste the script below. Save it as Clear_History.bat (Make sure to select "All Files" as the file type while saving) Right-click on the .bat file and select Run as administrator
@echo off
cls
echo Clearing Recent File Usage History...
:: Delete Recent Items
del /F /Q "%AppData%\Microsoft\Windows\Recent\*"
echo Recent File Usage History Cleared.
pause
:: Clear Jump List History
del /F /Q "%AppData%\Microsoft\Windows\Recent\AutomaticDestinations\*"
del /F /Q "%AppData%\Microsoft\Windows\Recent\CustomDestinations\*"
echo Jump List History Cleared.
pause
:: Clear Explorer Run History
reg delete "HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\RunMRU" /f
echo Explorer Run History Cleared.
pause
:: Clear Quick Access History
del /F /Q "%AppData%\Microsoft\Windows\Recent\*"
del /F /Q "%AppData%\Microsoft\Windows\Recent\AutomaticDestinations\*"
del /F /Q "%AppData%\Microsoft\Windows\Recent\CustomDestinations\*"
echo Quick Access History Cleared.
pause
:: Clear Temp Files
del /F /S /Q "%temp%\*.*"
rd /S /Q "%temp%"
md "%temp%"
echo Temporary Files Cleared.
pause
:: Clear Prefetch Files
del /F /S /Q "C:\Windows\Prefetch\*.*"
echo Prefetch Files Cleared.
pause
:: Clear MRU (Most Recently Used) history
reg delete "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\ComDlg32\OpenSavePidlMRU" /f
reg delete "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\ComDlg32\OpenSaveMRU" /f
echo MRU History Cleared.
pause
:: Clear Recent Program Traces
reg delete "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Search\RecentApps" /f
echo Recently Used Programs Cleared.
pause
:: Done
echo All tasks completed successfully.
pause
No comments:
Post a Comment