66
edits
Changes
remove-extensions.cmd updated for 32/64 bit
set return=goto :eof
set rmdir=rmdir /s /q
:: :: give args on command line
:: Install REMOVE a Mozilla extension XPI package into from a system-wide folder, and adddelete
:: the registry key required to tell the Mozilla app it's there.
::
:mozextn
if exist "%ProgramFiles%\Mozilla Firefox\firefox.exe" goto :nurXP
if not exist "%ProgramFiles(x86)%\Mozilla Firefox\firefox.exe" %return%
:nur32
set extnroot=%CommonProgramFiles(x86)%\Mozilla Shared\Extensions
if not exist "%extnroot%" mkdir "%extnroot%"
if errorlevel 1 %return%
set key=HKLM\Software\Wow6432Node\Mozilla\%1\Extensions
goto nextall
:nurXP
set extnroot=%CommonProgramFiles%\Mozilla Shared\Extensions
if not exist "%extnroot%" mkdir "%extnroot%"
if errorlevel 1 %return%
set key=HKLM\Software\Mozilla\%1\Extensions
:nextall
set extndir=%extnroot%\%2
for /f "skip=2 tokens=*" %%L in ('find "<em:id>" "%extndir%\install.rdf"') do @(
goto :mozextn1
)
:mozextn1
set id=%line:~8,-9%
if "%id%"=="" (
verify error 2>nul
%return%
)
for /f "skip=4 tokens=2*" %%A in ('reg query "%key%" /v "%id%"') do set olddir=%%B
if not "%olddir%"=="%extndir%" if exist "%olddir%" %rmdir% "%olddir%"
reg add delete "%key%" /v "%id%" /d "%extndir%" /f
%return%
</source>