File tree Expand file tree Collapse file tree 1 file changed +18
-2
lines changed
Expand file tree Collapse file tree 1 file changed +18
-2
lines changed Original file line number Diff line number Diff line change @@ -3,7 +3,7 @@ TITLE prefs.js cleaner
33
44REM ### prefs.js cleaner for Windows
55REM ## author: @claustromaniac
6- REM ## version: 2.3
6+ REM ## version: 2.4
77
88CD /D " %~dp0 "
99
1313ECHO ########################################
1414ECHO #### prefs.js cleaner for Windows ####
1515ECHO #### by claustromaniac ####
16- ECHO #### v2.3 ####
16+ ECHO #### v2.4 ####
1717ECHO ########################################
1818ECHO :
1919CALL :message " This script should be run from your Firefox profile directory."
@@ -28,6 +28,7 @@ IF ERRORLEVEL 3 (EXIT /B)
2828IF ERRORLEVEL 2 (GOTO :showhelp)
2929IF NOT EXIST " user.js" (CALL :abort " user.js not found in the current directory." 30)
3030IF NOT EXIST " prefs.js" (CALL :abort " prefs.js not found in the current directory." 30)
31+ CALL :strlenCheck
3132CALL :FFcheck
3233CALL :message " Backing up prefs.js..."
3334SET " _time = %time: =0 % "
5051ECHO : %~1
5152ECHO :
5253GOTO :EOF
54+ REM ### string length Check Function ####
55+ :strlenCheck
56+ SET /a cnt = 0
57+ setlocal ENABLEDELAYEDEXPANSION
58+ FOR /F " tokens=1,* delims=:" %%G IN ('FINDSTR /N " ^" prefs.js') DO (
59+ ECHO :%%H > nul
60+ SET /a cnt += 1
61+ IF /I " %%G " NEQ " !cnt! " (
62+ ECHO :
63+ CALL :message " ERROR: line !cnt! in prefs.js is too long."
64+ (CALL :abort " Aborting ..." 30)
65+ )
66+ )
67+ endlocal
68+ GOTO :EOF
5369REM ####### Firefox Check Function ######
5470:FFcheck
5571TASKLIST /FI " IMAGENAME eq firefox.exe" 2 > NUL | FIND /I /N " firefox.exe" > NUL
You can’t perform that action at this time.
0 commit comments