(view source code of delflash.bat as plain text)
@ECHO OFF
:: Check Windows version (NT 4+ required)
IF NOT "%OS%"=="Windows_NT" GOTO Syntax
:: Use local variables
SETLOCAL ENABLEDELAYEDEXPANSION
:: Initialize variables
SET Quiet=
SET Count=0
SET Cooky=Cookies
:: /Q is the only valid (optional) command line argument
IF /I "%~1"=="/Q" (
SET Quiet=/Q
) ELSE (
IF NOT "%~1"=="" GOTO Syntax
)
IF /I NOT "%Quiet%"=="/Q" (
CALL :Syntax
ECHO.
PAUSE
ECHO.
)
:: Display a message unless in quiet mode (/Q switch)
IF NOT "%Quiet%"=="/Q" (
ECHO Search and destroy Local Shared Objects ^(Flash Cookies^) ...
ECHO.
)
:: Macromedia Flash Player
FOR %%A IN ("%UserProfile%\Application Data" "%LocalAppData%") DO (
SET FPDir=%%~A\Macromedia\Flash Player
FOR %%B IN ("macromedia.com\support\flashplayer\sys" "#SharedObjects") DO (
IF /I NOT "%Quiet%"=="/Q" (
ECHO Searching "!FPDir!\%%~B" for Flash Cookies . . .
)
PUSHD "!FPDir!\%%~B"
IF NOT ERRORLEVEL 1 (
FOR /F "tokens=*" %%C IN ('DIR /AD /B "!FPDir!\%%~B\*" 2^>NUL') DO (
CD | FIND /I "!FPDir!\%%~B" >NUL
IF NOT ERRORLEVEL 1 (
SET /A Count = !Count! + 1
RD %Quiet% /S "%%~fC"
ECHO.
)
)
)
POPD
)
)
:: Google Chrome's Flash Player
SET FPDir=%LocalAppData%\Google\Chrome\User Data\Default\Pepper Data\Shockwave Flash\WritableRoot\#SharedObjects
IF /I NOT "%Quiet%"=="/Q" (
ECHO Searching "%FPDir%" for Flash Cookies . . .
)
PUSHD "%FPDir%"
IF NOT ERRORLEVEL 1 (
FOR /F "tokens=*" %%C IN ('DIR /AD /B "%FPDir%\*" 2^>NUL') DO (
CD | FIND /I "%FPDir%" >NUL
IF NOT ERRORLEVEL 1 (
SET /A Count = !Count! + 1
RD %Quiet% /S "%%~fC"
ECHO.
)
)
)
POPD
:: Format the message
IF %Count% EQU 1 SET Cooky=Cooky
IF %Count% EQU 0 SET Count=No
:: Display a message unless in quiet mode (/Q switch)
IF NOT "%Quiet%"=="/Q" (
ECHO %Count% Flash %Cooky% found.
ECHO.
)
ENDLOCAL
GOTO:EOF
:UCName
SET UCName=%~1
SET UCName=%UCName:a=A%
SET UCName=%UCName:b=B%
SET UCName=%UCName:c=C%
SET UCName=%UCName:d=D%
SET UCName=%UCName:e=E%
SET UCName=%UCName:f=F%
SET UCName=%UCName:g=G%
SET UCName=%UCName:h=H%
SET UCName=%UCName:i=I%
SET UCName=%UCName:j=J%
SET UCName=%UCName:k=K%
SET UCName=%UCName:l=L%
SET UCName=%UCName:m=M%
SET UCName=%UCName:n=N%
SET UCName=%UCName:o=O%
SET UCName=%UCName:p=P%
SET UCName=%UCName:q=Q%
SET UCName=%UCName:r=R%
SET UCName=%UCName:s=S%
SET UCName=%UCName:t=T%
SET UCName=%UCName:u=U%
SET UCName=%UCName:v=V%
SET UCName=%UCName:w=W%
SET UCName=%UCName:x=X%
SET UCName=%UCName:y=Y%
SET UCName=%UCName:z=Z%
GOTO:EOF
:Syntax
IF "%OS%"=="Windows_NT" CALL :UCName "%~nx0"
CLS
ECHO.
IF NOT "%OS%"=="Windows_NT" ECHO %0, Version 2.01 for Windows NT 4+
IF "%OS%"=="Windows_NT" ECHO %UCName%, Version 2.01 for Windows NT 4^+
ECHO Delete all "Local Shared Object", also known as "Flash Cookies", from the
ECHO current user's profile
ECHO.
IF NOT "%OS%"=="Windows_NT" ECHO Usage: %0 [/Q]
IF "%OS%"=="Windows_NT" ECHO ECHO Usage: %UCName% [ /Q ]
ECHO.
ECHO Where: /Q Quiet mode: no prompt for confirmation, no messages
ECHO.
ECHO Notes: It is recommended to run this batch file without the /Q switch the
ECHO first time, with the user ID for which it is intended, to check if
ECHO the directories to be deleted are the right ones.
ECHO Though every effort has been made to avoid failures, no guarantee
ECHO can be made for the proper functioning of this batch file on your
ECHO computer. Use this batch file entirely at your own risk.
ECHO To manage "Flash Cookies", visit
ECHO http://www.macromedia.com/support/documentation/en/flashplayer/help
ECHO /settings_manager02.html
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.0128 seconds