これは通常、バッチで行うことではありませんが、かなり簡単です。
@echo off
setlocal enableextensions enabledelayedexpansion
rem the input file
set inputfile=file.txt
rem temporary file for output, we can't just write into the
rem same file we're reading
set tempfile=%random%-%random%.tmp
rem delete the temporary file if it's already there
rem shouldn't really happen, but just in case ...
copy /y nul %tempfile%
rem line counter
set line=0
rem loop through the file
for /f "delims=" %%l in (%inputfile%) do (
set /a line+=1
if !line!==29 (
rem hardcoded, at the moment, you might want to look
rem here whether the line really starts with "options"
rem and just put another number at the end.
echo option=22>>%tempfile%
) else (
echo %%l>>%tempfile%
)
)
del %inputfile%
ren %tempfile% %inputfile%
endlocal
適応させたい場合は、一般的な方向性を示す必要があります。