Skip to content

Commit 8259191

Browse files
kewihaearthlng
andauthored
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>
1 parent b99dd27 commit 8259191

File tree

1 file changed

+11
-6
lines changed

1 file changed

+11
-6
lines changed

prefsCleaner.bat

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,19 @@ TITLE prefs.js cleaner
33

44
REM ### prefs.js cleaner for Windows
55
REM ## author: @claustromaniac
6-
REM ## version: 2.5
6+
REM ## version: 2.6
77

88
CD /D "%~dp0"
99

10+
IF /I "%~1"=="-unattended" (SET _ua=1)
11+
1012
:begin
1113
ECHO:
1214
ECHO:
1315
ECHO ########################################
1416
ECHO #### prefs.js cleaner for Windows ####
1517
ECHO #### by claustromaniac ####
16-
ECHO #### v2.5 ####
18+
ECHO #### v2.6 ####
1719
ECHO ########################################
1820
ECHO:
1921
CALL :message "This script should be run from your Firefox profile directory."
@@ -22,10 +24,13 @@ CALL :message "This will allow inactive preferences to be reset to their default
2224
ECHO This Firefox profile shouldn't be in use during the process.
2325
CALL :message ""
2426
TIMEOUT 1 /nobreak >nul
25-
CHOICE /C SHE /N /M "Start [S] Help [H] Exit [E]"
26-
CLS
27-
IF ERRORLEVEL 3 (EXIT /B)
28-
IF ERRORLEVEL 2 (GOTO :showhelp)
27+
28+
IF NOT DEFINED _ua (
29+
CHOICE /C SHE /N /M "Start [S] Help [H] Exit [E]"
30+
CLS
31+
IF ERRORLEVEL 3 (EXIT /B)
32+
IF ERRORLEVEL 2 (GOTO :showhelp)
33+
)
2934
IF NOT EXIST "user.js" (CALL :abort "user.js not found in the current directory." 30)
3035
IF NOT EXIST "prefs.js" (CALL :abort "prefs.js not found in the current directory." 30)
3136
CALL :strlenCheck

0 commit comments

Comments
 (0)