Advertisement
dubbyOW

dubbyOW _ GPU-Shader-Cache-Cleaner

Feb 29th, 2024
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Winbatch 1.66 KB | Source Code | 0 0
  1. @echo off
  2. setlocal
  3.  
  4. set "dxCachePath=%LOCALAPPDATA%\NVIDIA\DXCache"
  5. set "glCachePath=%LOCALAPPDATA%\NVIDIA\GLCache"
  6. set "steamShaderCachePath=C:\Program Files (x86)\Steam\steamapps\shadercache"
  7. set "iobitUnlockerPath=C:\Program Files (x86)\IObit\IObit Unlocker\IObitUnlocker.exe"
  8.  
  9. echo Would you like to clear NVIDIA and Steam Shader Cache? (Y/N)
  10. set /p choice=
  11.  
  12. if /i "%choice%"=="Y" (
  13.     if exist "%dxCachePath%" (
  14.         echo Removing DirectX NVIDIA Shader Cache...
  15.         rd /s /q "%dxCachePath%"
  16.         echo DirectX NVIDIA Shader Cache removed.
  17.     ) else (
  18.         echo The DirectX NVIDIA Shader Cache folder does not exist.
  19.     )
  20.  
  21.     if exist "%glCachePath%" (
  22.         echo Removing OpenGL NVIDIA Shader Cache...
  23.         rd /s /q "%glCachePath%"
  24.         echo OpenGL NVIDIA Shader Cache removed.
  25.     ) else (
  26.         echo The OpenGL NVIDIA Shader Cache folder does not exist.
  27.     )
  28.  
  29.     if exist "%steamShaderCachePath%" (
  30.         echo Removing Steam Shader Cache...
  31.         rd /s /q "%steamShaderCachePath%"
  32.         echo Steam Shader Cache removed.
  33.     ) else (
  34.         echo The Steam Shader Cache folder does not exist.
  35.     )
  36.  
  37.     echo.
  38.     echo Trying to unlock remaining files...
  39.     "%iobitUnlockerPath%" /delete "%dxCachePath%" /s
  40.     "%iobitUnlockerPath%" /delete "%glCachePath%" /s
  41.     "%iobitUnlockerPath%" /delete "%steamShaderCachePath%" /s
  42.     echo.
  43.  
  44.     echo Shader Caches cleared successfully, press any key to exit...
  45.     pause >nul
  46. ) else if /i "%choice%"=="N" (
  47.     echo Operation aborted, press any key to exit...
  48.     pause >nul
  49.     exit /b
  50. ) else (
  51.     echo Invalid choice. Please try again.
  52.     pause >nul
  53. )
  54.  
  55. endlocal
  56.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement