我正在尝试将我的批处理文件添加到main.config中的数量,但它只是继续编写" Echo Is Off"在文件中。
这是密封调用的批处理文件。它读取该行,将其设置为%line%,并添加到该行。然后它将它打印回同一行。
@echo off
for /f "skip=1" %%G IN (main.config) DO if not defined line set "line=%%G"
set /a ress==%line%+1
call :RL RL 2 main.config %ress%
goto :eof
:RL
(For /F "tokens=1* delims=]" %%A in ('type "%~3" ^| find /n /v ""') DO (Call Set /A "LINE+=1" && (CMD /C "IF NOT "%%LINE%%" EQU "%~2" (if "%%B" EQU "" (Echo+>> "%~3.NEW") ELSE ((Echo %%B)>> "%~3.NEW")) ELSE ((Echo %~4)>> "%~3.NEW")"))) && (CALL :RENAMER "%~3") & (GOTO:EOF)
:RENAMER
(REN "%~1" "%~nx1.BAK") & (MOVE /Y "%~1.BAK" "%TEMP%\" >NUL) & (REN "%~1.NEW" "%~nx1") & (GOTO:EOF)
这是seal.bat
的开始@echo off
call exithandl.bat
:main
500 lines of absolute trash