(view source code of ffxcache.bat as plain text)
@ECHO OFF
IF NOT "%OS%"=="Windows_NT" GOTO Syntax
SETLOCAL ENABLEDELAYEDEXPANSION
IF NOT "%~1"=="" GOTO Syntax
TASKLIST.EXE >NUL 2>&1
IF NOT ERRORLEVEL 1 (
TASKLIST.EXE /FI "imagename eq firefox.exe" 2>NUL | FIND /I "firefox.exe" >NUL
IF NOT ERRORLEVEL 1 (
ECHO.
ECHO Firefox is still running, unable to clear the cache.
GOTO Syntax
)
)
SET Profile=
PUSHD "%UserProfile%\Application Data\Mozilla\Firefox"
IF NOT ERRORLEVEL 1 FOR /F "tokens=2 delims==" %%A IN ('TYPE profiles.ini ^| FINDSTR.EXE /R /B /I /C:"Path="') DO SET Profile=%%~nxA
POPD
IF NOT "%Profile%"=="" (
FOR %%A IN (Cache Cache.Trash OfflineCache) DO (
PUSHD "%UserProfile%\Local Settings\Application Data\Mozilla\Firefox\Profiles\%Profile%\%%~A" 2>NUL
IF /I "!CD!"=="%UserProfile%\Local Settings\Application Data\Mozilla\Firefox\Profiles\%Profile%\%%~A" RD /Q /S "%UserProfile%\Local Settings\Application Data\Mozilla\Firefox\Profiles\%Profile%\%%~A" 2>NUL
POPD
)
) ELSE (
ECHO.
ECHO Profile directory not found or no access.
GOTO Syntax
)
ENDLOCAL
GOTO:EOF
:Syntax
ECHO.
ECHO FfxCache.bat, Version 1.10 for Windows NT 4 and later
ECHO Flush the Firefox cache directory in your own profile
ECHO.
ECHO Usage: FFXCACHE
ECHO.
ECHO Note: This batch file won't be able to clear the cache when Firefox is
ECHO running. In Windows XP and later, the batch file will check if
ECHO Firefox is running and abort if so, in Windows NT 4 and 2000 the
ECHO batch file will display an error message for each cache file in use.
ECHO.
ECHO Written by Rob van der Woude
ECHO http://www.robvanderwoude.com
IF "%OS%"=="Windows_NT" ENDLOCAL
page last modified: 2024-04-16; loaded in 0.0050 seconds