Like this :
Edit :
@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\"*.*
)
Question
I have the directory structure
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
...
I want to delete Temporary Internet Files\*.*
from all c:\users\
x|y|z...
\...
Is there a way to do that?
Solution
Like this :
Edit :
@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\"*.*
)
OTHER TIPS
@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
)
)
This will search for location of the users profiles. If the output is correct, remove the echo
command.