Obrigado por todos, isso chegou a uma solução de trabalho. Sinta-se à vontade para usar este script para limpar o cache do navegador para todos os usuários:
@echo off
CLS
SETLOCAL ENABLEDELAYEDEXPANSION
REM @@@@ creating listfile path @@@@
IF NOT EXIST "%SystemDrive%\Temp" MD "%SystemDrive%\Temp"
SET "UserListFile=%SystemDrive%\Temp\userlist.txt"
REM @@@@ DELeting already existing listfile @@@@
IF NOT EXIST %UserListFile% GOTO STARTOFSCRIPT
DEL %UserListFile%
:STARTOFSCRIPT
REM @@@@ writing userlist into file @@@@
DIR %SystemDrive%\Users\ /A:D /B /R > %UserListFile%
REM @@@@ start of main FOR loop @@@@
FOR /F "tokens=*" %%A IN (%UserListFile%) DO (
REM ECHO %%A
CALL :BROWSERCLEAR "%%A"
)
GOTO ENDOFSCRIPT
:BROWSERCLEAR
SET UsrDir=%1
SET UsrDir=%UsrDir:"=%
%SystemDrive%
REM @@@@ Chrome cleaning part @@@@
IF NOT EXIST "%SystemDrive%\Users\%UsrDir%\AppData\Local\Google\Chrome\User Data\Default\" GOTO NOCHROMEDEFAULT
ECHO Cleaning Chrome in %UsrDir% ...
CD "%SystemDrive%\Users\%UsrDir%\AppData\Local\Google\Chrome\User Data\Default\"
DEL /Q /S /F "Application Cache" >NUL 2>&1
DEL /Q /S /F "Cache" >NUL 2>&1
DEL /Q /S /F "Media Cache" >NUL 2>&1
:NOCHROMEDEFAULT
:NOCHROMEDEFAULT2
IF NOT EXIST "%SystemDrive%\Users\%UsrDir%\AppData\Local\Google\Chrome\User Data\Guest Profile\" GOTO NOCHROMEGUEST
CD "%SystemDrive%\Users\%UsrDir%\AppData\Local\Google\Chrome\User Data\Guest Profile\"
DEL /Q /S /F "Application Cache" >NUL 2>&1
DEL /Q /S /F "Cache" >NUL 2>&1
DEL /Q /S /F "Media Cache" >NUL 2>&1
:NOCHROMEGUEST
:NOCHROMEGUEST2
FOR /L %%G IN (0,1,10) DO (
IF NOT EXIST "%SystemDrive%\Users\%UsrDir%\AppData\Local\Google\Chrome\User Data\Profile %%G\" GOTO NOPROFNUM
CD "%SystemDrive%\Users\%UsrDir%\AppData\Local\Google\Chrome\User Data\Profile %%G\"
DEL /Q /S /F "Application Cache" >NUL 2>&1
DEL /Q /S /F "Cache" >NUL 2>&1
DEL /Q /S /F "Media Cache" >NUL 2>&1
:NOPROFNUM
:NOPROFNUM2
)
REM @@@@ Mozilla cleaning part @@@@
IF NOT EXIST "%SystemDrive%\Users\%UsrDir%\AppData\Local\Mozilla\Firefox\Profiles\" GOTO NOMOZILLA
ECHO Cleaning Mozilla in %UsrDir% ...
SET DataDir=%SystemDrive%\Users\%UsrDir%\AppData\Local\Mozilla\Firefox\Profiles\
DEL /Q /S /F "%DataDir%" >NUL 2>&1
RD /S /Q "%DataDir%" >NUL 2>&1
for /d %%X in (%SystemDrive%\Users\%UsrDir%\AppData\Roaming\Mozilla\Firefox\Profiles\*) do DEL /Q /S /F %%X\*sqlite >NUL 2>&1
:NOMOZILLA
:NOMOZILLA2
REM @@@@ Internet Explorer cleaning part @@@@
IF NOT EXIST "%SystemDrive%\Users\%UsrDir%\AppData\Local\Microsoft\Intern~1\" GOTO NOEXPLR
ECHO Cleaning IE in %UsrDir% ...
SET DataDir=%SystemDrive%\Users\%UsrDir%\AppData\Local\Microsoft\Intern~1\
DEL /Q /S /F "%DataDir%" >NUL 2>&1
RD /S /Q "%DataDir%" >NUL 2>&1
SET History=%SystemDrive%\Users\%UsrDir%\AppData\Local\Microsoft\Windows\History\
DEL /Q /S /F "%History%" >NUL 2>&1
RD /S /Q "%History%" >NUL 2>&1
SET IETemp=%SystemDrive%\Users\%UsrDir%\AppData\Local\Microsoft\Windows\Tempor~1\
DEL /Q /S /F "%IETemp%" >NUL 2>&1
RD /S /Q "%IETemp%" >NUL 2>&1
SET Cookies=%SystemDrive%\Users\%UsrDir%\AppData\Roaming\Microsoft\Windows\Cookies\
DEL /Q /S /F "%Cookies%" >NUL 2>&1
RD /S /Q "%Cookies%" >NUL 2>&1
:NOEXPLR
:NOEXPLR2
REM @@@@ Opera cleaning part @@@@
IF NOT EXIST "%SystemDrive%\Users\%UsrDir%\AppData\Local\Opera\Opera\" GOTO NOOPERA
ECHO Cleaning Opera in %UsrDir% ...
SET DataDir=%SystemDrive%\Users\%UsrDir%\AppData\Local\Opera\Opera\
SET DataDir2=%SystemDrive%\Users\%UsrDir%\AppData\Roaming\Opera\Opera\
DEL /Q /S /F "%DataDir%" >NUL 2>&1
RD /S /Q "%DataDir%" >NUL 2>&1
DEL /Q /S /F "%DataDir2%" >NUL 2>&1
RD /S /Q "%DataDir2%" >NUL 2>&1
:NOOPERA
:NOOPERA2
REM @@@@ Safari cleaning part @@@@
IF NOT EXIST "%SystemDrive%\Users\%UsrDir%\AppData\Local\Applec~1\Safari\" GOTO NOSAFARI
ECHO Cleaning Safari in %UsrDir% ...
SET DataDir=%SystemDrive%\Users\%UsrDir%\AppData\Local\Applec~1\Safari\
SET DataDir2=%SystemDrive%\Users\%UsrDir%\AppData\Roaming\Applec~1\Safari\
DEL /Q /S /F "%DataDir%\History" >NUL 2>&1
RD /S /Q "%DataDir%\History" >NUL 2>&1
DEL /Q /S /F "%DataDir%\Cache.db" >NUL 2>&1
DEL /Q /S /F "%DataDir%\WebpageIcons.db" >NUL 2>&1
DEL /Q /S /F "%DataDir2%" >NUL 2>&1
RD /S /Q "%DataDir2%" >NUL 2>&1
:NOSAFARI
:NOSAFARI2
:ENDOFSCRIPT
DEL /Q /S /F "%UserListFile%" >NUL 2>&1