Código (dos) [Seleccionar]
@Echo OFF
:: By Elektro H@cker
SET "FILE=Test.txt"
Set "COMMAND=IF "%%VAR%%" EQU "SOMETHING" (THIS^) ELSE (THAT^)"
Set /A "INSERT__IN_LINE=3"
For /F "Useback Tokens=*" %%# in ("%FILE%") DO (
Call Set /A "Line+=1"
CMD /C "IF "%%LINE%%" EQU "%INSERT__IN_LINE%" (Echo %COMMAND%>>"%FILE%.new.txt")"
Echo %%#>>"%FILE%.new.txt"
)
Pause&Exit
Output:
test.txt.new.txt
Código [Seleccionar]
comando1
comando2
IF "%VAR%" EQU "SOMETHING" (THIS) ELSE (THAT)
comando3
comando4
comando5
saludos