Advertisement
MrChrHD

Windows 11 Explorer Crash Fix

May 21st, 2023 (edited)
2,120
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Winbatch 1.19 KB | Software | 0 0
  1. REM THIS IS TO BE USED IN A .CMD FILE
  2. @echo off
  3. call
  4.  
  5. REM Verbose
  6. echo === Clear Explorer Cache (potential crash fix) ===
  7. echo:
  8.  
  9. echo This script will restart your PC. Please ensure that your work is saved before continuing.
  10. pause
  11.  
  12. REM Check Admin permissions
  13. echo:
  14. echo This script requires admin permissions. Checking current permissions...
  15.  
  16. net session >nul 2>&1
  17. if %errorlevel% equ 0 (
  18.     echo Success!
  19.     echo:
  20. ) else (
  21.     echo Error! Please run this script as Administrator.
  22.     pause
  23.     exit /b 2
  24. )
  25.  
  26. REM The fix is to delete all files in %APPDATA%\Microsoft\Windows\Recent\AutomaticDestinations
  27. echo Applying fix...
  28.  
  29. del /S /Q %APPDATA%\Microsoft\Windows\Recent\AutomaticDestinations >nul 2>&1
  30. if %errorlevel% equ 0 (
  31.     echo Fix applied!
  32.     echo:
  33. ) else (
  34.     echo Error! Please try again.
  35.     pause
  36.     exit /b 1
  37. )
  38.  
  39. REM After applying the fix, the computer must be restarted
  40. echo Your computer will restart in 10 seconds.
  41. shutdown /r /T 10
  42. if %errorlevel% equ 0 (
  43.     echo Restart command sent. Thanks for using this script
  44.     pause
  45.     exit /b 0
  46. ) else (
  47.     echo Error while trying to restart your PC. Please restart manually.
  48.     pause
  49.     exit /b 1
  50. )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement