Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
prefsCleaner.bat: add -unattended flag (#1616)
* prefsCleaner.bat: add -unattended flag

Usage:
  prefsCleaner.bat -unattended

Skips the prompt for user input and proceeds when -unattended is specified. If omitted, default behaviour is unchanged.

---------

Signed-off-by: Keith Harrison <keithh@protonmail.com>
Co-authored-by: earthlng <earthlng@users.noreply.github.com>
  • Loading branch information
kewiha and earthlng committed Feb 5, 2023
1 parent b99dd27 commit 8259191
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions prefsCleaner.bat
Expand Up @@ -3,17 +3,19 @@ TITLE prefs.js cleaner

REM ### prefs.js cleaner for Windows
REM ## author: @claustromaniac
REM ## version: 2.5
REM ## version: 2.6

CD /D "%~dp0"

IF /I "%~1"=="-unattended" (SET _ua=1)

:begin
ECHO:
ECHO:
ECHO ########################################
ECHO #### prefs.js cleaner for Windows ####
ECHO #### by claustromaniac ####
ECHO #### v2.5 ####
ECHO #### v2.6 ####
ECHO ########################################
ECHO:
CALL :message "This script should be run from your Firefox profile directory."
Expand All @@ -22,10 +24,13 @@ CALL :message "This will allow inactive preferences to be reset to their default
ECHO This Firefox profile shouldn't be in use during the process.
CALL :message ""
TIMEOUT 1 /nobreak >nul
CHOICE /C SHE /N /M "Start [S] Help [H] Exit [E]"
CLS
IF ERRORLEVEL 3 (EXIT /B)
IF ERRORLEVEL 2 (GOTO :showhelp)

IF NOT DEFINED _ua (
CHOICE /C SHE /N /M "Start [S] Help [H] Exit [E]"
CLS
IF ERRORLEVEL 3 (EXIT /B)
IF ERRORLEVEL 2 (GOTO :showhelp)
)
IF NOT EXIST "user.js" (CALL :abort "user.js not found in the current directory." 30)
IF NOT EXIST "prefs.js" (CALL :abort "prefs.js not found in the current directory." 30)
CALL :strlenCheck
Expand Down

0 comments on commit 8259191

Please sign in to comment.