我有目录结构
c:\Users\x\AppData\Local\Microsoft\Windows\Temporary Internet Files
c:\Users\y\AppData\Local\Microsoft\Windows\Temporary Internet Files
c:\Users\z\AppData\Local\Microsoft\Windows\Temporary Internet Files
...
我想从所有Temporary Internet Files\*.*
c:\users\
x|y|z...
\...
有办法吗?
答案 0 :(得分:2)
像这样:
编辑:
@echo off
for /f "delims=" %%a in ('dir /b /ad c:\users\') do (
del /q "c:\Users\%%a\AppData\Local\Microsoft\Windows\Temporary Internet Files\"*.*
)
答案 1 :(得分:1)
@echo off
setlocal enableextensions disabledelayedexpansion
for /F "tokens=2,*" %%a in ('reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList" /s ^| find "ProfileImagePath" ') do (
call pushd "%%~b\AppData\Local\Microsoft\Windows\Temporary Internet Files" > nul 2> nul
if not errorlevel 1 (
cd
echo rmdir . /s /q
popd
)
)
这将搜索用户个人资料的位置。如果输出正确,请删除echo
命令。