Firefox & Chrome history deleter
Posted: 26 Dec 2016 16:56
Save time by using my Firefox & Chrome history deleter.
code:
code:
Code: Select all
@echo off
tasklist | find "firefox.exe" >nul 2>nul
if "%errorlevel%" == "0" (goto ffxopen) else (goto ffxclosed)
:ffxopen:
set /p "ffxinput=the command cannot be executed because firefox is running. close it? [y/n]"
if "%ffxinput%" == "y" (goto yf) else (if "%ffxinput%" == "n" (goto nf) else (echo unknown command: %ffxinput%))
:yf:
taskkill /IM firefox.exe /f
goto ffxclosed
:nf:
goto chrome
:ffxclosed:
pushd C:\
cd C:\Users\%USERNAME%\AppData\Roaming\Mozilla\Firefox\Profiles >nul 2>nul
if "%errorlevel%" == "1" (goto ffxui) else (goto ffxi)
:ffxui:
echo firefox is not installed.
goto chrome
:ffxi:
FOR /D /r %%G in ("*.default") DO cd %%G
del places.sqlite >nul 2>nul
:chrome:
tasklist | find "chrome.exe" >nul 2>nul
if "%errorlevel%" == "0" (goto chopen) else (goto chclosed)
:chopen:
set /p "chinput=the command cannot be executed because chrome is running. close it? [y/n]"
if "%chinput%" == "y" (goto cy) else (if "%chinput%" == "n" (goto cn) else (echo unknown command: %chinput%))
:cy:
taskkill /IM chrome.exe /f
goto chclosed
:cn:
goto :eof
:chclosed:
pushd C:\
cd C:\Users\%USERNAME%\AppData\Local\Google\Chrome\User Data\Default >nul 2>nul
if "%errorlevel%" == "1" (goto chni) else (goto chi)
:chni:
echo chrome is not installed
goto :eof
:chi:
del History >nul 2>nul