276 words
1 minute
How to clean Windows cache
2020-02-02
2021-12-02
统计加载中...
Terminal window
@echo off
:: Check admin
net session >nul 2>&1
if %errorLevel% == 0 (
echo Running as admin
) else (
echo Requesting for admin
powershell -Command "Start-Process '%~f0' -Verb runAs"
exit /b
)
:: Set default dir
set "LocalDir=%USERPROFILE%\AppData\Local"
set "LocalLowDir=%USERPROFILE%\AppData\LocalLow"
set "RoamingDir=%USERPROFILE%\AppData\Roaming"
:: Set custom dir
set "UnrealEngineDir=C:\Program Files\Epic Games"
@rem Steam
set "steamFolder=C:\Program Files (x86)\Steam"
if exist "%steamFolder%\appcache" (
rd /s /q "%steamFolder%\appcache"
)
@rem Epic Games
if exist "%LocalDir%\EpicGamesLauncher\Saved\" (
for /d %%D in ("%LocalDir%\EpicGamesLauncher\Saved\*webcache*") do (
rd /s /q "%%D"
)
)
@rem Unreal Engine
if exist "%LocalDir%\UnrealEngineLauncher\" (
rd /s /q "%LocalDir%\UnrealEngineLauncher"
)
if exist "%LocalDir%\UnrealBuildTool\" (
rd /s /q "%LocalDir%\UnrealBuildTool"
)
if exist "%LocalDir%\UnrealEngine\Editor\ProjectEditorRecords.json" (
del /q "%LocalDir%\UnrealEngine\Editor\ProjectEditorRecords.json"
)
for /d %%D in ("%UnrealEngineDir%\*") do (
if exist "%%D\.vscode\" (
rd /s /q "%%D\.vscode"
)
if exist "%%D\Engine\DerivedDataCache\" (
rd /s /q "%%D\Engine\DerivedDataCache"
)
)
@rem VS Code
set "vsCodeDir=%RoamingDir%\Code"
if exist "%vsCodeDir%\Cache\" (
rd /s /q "%vsCodeDir%\Cache"
)
if exist "%vsCodeDir%\CachedData\" (
rd /s /q "%vsCodeDir%\CachedData"
)
if exist "%vsCodeDir%\logs\" (
rd /s /q "%vsCodeDir%\logs"
)
if exist "%vsCodeDir%\blob_storage\" (
rd /s /q "%vsCodeDir%\blob_storage"
)
if exist "%vsCodeDir%\User\workspaceStorage\" (
for /d %%D in ("%vsCodeDir%\User\workspaceStorage\*") do (
rd /s /q "%%D"
)
del /q "%vsCodeDir%\User\workspaceStorage\*"
)
@rem System
if exist "C:\DumpStack.log" (
del /q "C:\DumpStack.log"
)
if exist "%LocalLowDir%\" (
for %%F in ("%LocalLowDir%\*") do (
if "%%~xF"=="" (
echo Deleting file: %%F
del /q "%%F"
)
)
)
if exist "%LocalDir%\CEF\" (
rd /s /q "%LocalDir%\CEF"
)
if exist "%LocalDir%\D3DSCache\" (
rd /s /q "%LocalDir%\D3DSCache"
)
if exist "%LocalDir%\CrashReportClient\" (
rd /s /q "%LocalDir%\CrashReportClient"
)
if exist "%LocalDir%\VirtualStore\" (
rd /s /q "%LocalDir%\VirtualStore"
)
echo Cleanup completed.
pause
How to clean Windows cache
https://blog.spr-aachen.com/posts/tutorial-windows/cleanwindowscache/
Author
Spr-Aachen
Published at
2020-02-02
License
CC BY-NC-SA 4.0

Some information may be outdated

封面
Music
Artist
封面
Music
Artist
0:00 / 0:00