Batch delete edge browser cache files

@echo off
rem 桌面创建删除日志
set logpath=%USERPROFILE%\DESKTOP\clearEdgLog.txt
rem 设置edge浏览器缓存文件路径
set dirpath=%LOCALAPPDATA%\Packages\Microsoft.MicrosoftEdge_8wekyb3d8bbwe\AC\#!001\MicrosoftEdge\Cache\
echo.>%logpath%
rem 删除不是系统,只读和隐藏的文件
for /f "tokens=*" %%f in ('dir /b /s /a-d-r-h-s %dirpath%') do (
echo 删除文件:%%f>>%logpath%
echo.>>%logpath%
del /q "%%f"
)
rem 删除层级目录
for /f "tokens=*" %%d in ('dir /b /s /ad-r-h-s %dirpath%^|sort /r') do (
echo 删除目录:%%d>>%logpath%
echo.>>%logpath%
rmdir /q "%%d"
)
pause
exit

Instructions:

Save Notepad, the file name is xxx.bat, select "All Files" as the save type, and double-click to run

Guess you like

Origin blog.csdn.net/humors221/article/details/109509945