char0n wrote:Code: Select all
@echo off cd "%APPDATA%\Mozilla\Firefox\Profiles" if exist "fixed_search_json.txt" goto :exit for /F "usebackq" %%i in (`dir /a:d /b`) do @cd %%i del search.json /s /q cd "%APPDATA%\Mozilla\Firefox\Profiles" echo "done" > fixed_search_json.txt :exit exit
This code will work if as long as there is only a single profile, since the FOR loop ends up in the last folder returned by DIR, and that's the only folder in which the DEL command is executed.
I'd recommend this slight adjustment"
Code: Select all
@echo off
cd "%APPDATA%\Mozilla\Firefox\Profiles"
if exist "fixed_search_json.txt" goto :exit
for /F "usebackq" %%i in (`dir /a:d /b`) do @del "%%i\search.json" /s /q
cd "%APPDATA%\Mozilla\Firefox\Profiles"
echo "done" > fixed_search_json.txt
:exit
exit