I have a notes.ini file with the following starting line:
[Notes]
Directory=c:\lotus\notes\data
I would like to change the "Directory=" parameter to Directory = D:\Users\fr21466\AppData\Roaming\notes
I´m trying this code:
@echo off
set file=c:\lotus\notes\notes.ini
set newline=Directory=%appdata%\notes
set insertline=2
set output=%appdata%\notes\notes.ini
(for /f "tokens=1* delims=[]" %%a in ('find /n /v "##" ^< "%file%"') do (
if "%%~a"=="%insertline%" (
echo %newline%
REM ECHO.%%b
) ELSE (
echo.%%b
)
)) > %output%
But the output file is generating this:
It is generating the file, but cutting the symbol: "[" in the first column
Notes]
Directory=D:\Users\fr21466\AppData\Roaming\notes
Can someone please help me to solve this?
Thank You!