wolf0425 Цитата: а у меня - единожды. точно ничего не перепутал в условиях?
[more=Вот точный код батника]set "strNum="
set "strAcc="
for /F "usebackq tokens=1* delims=:" %%A in (`findstr /L "user_pref(\"mail.accountmanager.accounts\"" temp.txt`) do (set strNum=%%A&set strAcc=%%B)
set /A strNum=%strNum%-1
for /L %%i in (1,1,%strNum%) do (
for /F "usebackq tokens=1* delims=:" %%A in (`findstr /B /L %%i: temp.txt`) do (call :DELNUM "%%B" temp2.txt)
)
goto :EOF
:DELNUM
echo %1[/more]
[more=Вот кусок файла, из к-го берутся строки]1:# Mozilla User Preferences
2:
3:/* Do not edit this file.
4: *
5: * If you make changes to this file while the application is running,
6: * the changes will be overwritten when the application exits.
7: *
8: * To make a manual change to preferences, you can visit the URL about:config
9: * For more information, see
http://www.mozilla.org/unix/customizing.html#prefs 10: */
11:
12:user_pref("accessibility.typeaheadfind.flashBar", 0);
13:user_pref("app.update.lastUpdateTime.addon-background-update-timer", 1277727974);[/more]
[more=А это вывод консоли во время исполнения батника]D:\>set "strNum="
D:\>set "strAcc="
D:\>for /F "usebackq tokens=1* delims=:" %A in (`findstr /L "user_pref(\"mail.accountmanager.accounts\"" temp.txt`) do (set strNum=%A & set strAcc=%B )
D:\>(set strNum=76 & set strAcc=user_pref("mail.accountmanager.accounts", "account2,account3,account1,account4,account5,account6,account7,account8,account9,account10,account11"); )
D:\>(set strNum=76 & set strAcc=user_pref("mail.accountmanager.accounts", "account2,account3,account1,account4,account5,account6,account7,account8,account9,account10,account11"); )
D:\>set /A strNum=76-1
D:\>for /L %i in (1 1 75) do (for /F "usebackq tokens=1* delims=:" %A in (`findstr /B /L %i: temp.txt`) do (call :DELNUM "%B" temp2.txt ) )
D:\>(for /F "usebackq tokens=1* delims=:" %A in (`findstr /B /L 1: temp.txt`) do (call :DELNUM "%B" temp2.txt ) )
D:\>(call :DELNUM "# Mozilla User Preferences" temp2.txt )
D:\>echo "# Mozilla User Preferences"
"# Mozilla User Preferences"
D:\>(call :DELNUM "# Mozilla User Preferences" temp2.txt )
D:\>echo "# Mozilla User Preferences"
"# Mozilla User Preferences"
D:\>(for /F "usebackq tokens=1* delims=:" %A in (`findstr /B /L 2: temp.txt`) do (call :DELNUM "%B" temp2.txt ) )
D:\>(call :DELNUM "" temp2.txt )
D:\>echo ""
""
D:\>(call :DELNUM "" temp2.txt )
D:\>echo ""
""
D:\>(for /F "usebackq tokens=1* delims=:" %A in (`findstr /B /L 3: temp.txt`) do (call :DELNUM "%B" temp2.txt ) )
D:\>(call :DELNUM "/* Do not edit this file." temp2.txt )
D:\>echo "/* Do not edit this file."
"/* Do not edit this file."
D:\>(call :DELNUM "/* Do not edit this file." temp2.txt )
D:\>echo "/* Do not edit this file."
"/* Do not edit this file."
D:\>(for /F "usebackq tokens=1* delims=:" %A in (`findstr /B /L 4: temp.txt`) do (call :DELNUM "%B" temp2.txt ) )
D:\>(call :DELNUM " *" temp2.txt )
D:\>echo " *"
" *"
D:\>(call :DELNUM " *" temp2.txt )
D:\>echo " *"
" *"
D:\>(for /F "usebackq tokens=1* delims=:" %A in (`findstr /B /L 5: temp.txt`) do (call :DELNUM "%B" temp2.txt ) )
D:\>(call :DELNUM " * If you make changes to this file while the application is running," temp2.txt )
D:\>echo " * If you make changes to this file while the application is running,"
" * If you make changes to this file while the application is running,"
D:\>(call :DELNUM " * If you make changes to this file while the application is running," temp2.txt )
D:\>echo " * If you make changes to this file while the application is running,"
" * If you make changes to this file while the application is running,"
D:\>(for /F "usebackq tokens=1* delims=:" %A in (`findstr /B /L 6: temp.txt`) do (call :DELNUM "%B" temp2.txt ) )
D:\>(call :DELNUM " * the changes will be overwritten when the application exits." temp2.txt )
D:\>echo " * the changes will be overwritten when the application exits."
" * the changes will be overwritten when the application exits."
D:\>(call :DELNUM " * the changes will be overwritten when the application exits." temp2.txt )
D:\>echo " * the changes will be overwritten when the application exits."
" * the changes will be overwritten when the application exits."
D:\>(for /F "usebackq tokens=1* delims=:" %A in (`findstr /B /L 7: temp.txt`) do (call :DELNUM "%B" temp2.txt ) )
D:\>(call :DELNUM " *" temp2.txt )
D:\>echo " *"
" *"
D:\>(call :DELNUM " *" temp2.txt )
D:\>echo " *"
" *"[/more]
Вообщем, не знаю что и думать... Даже перегрузил комп на всякий - не помогло.