Very glad with this reply so effective,
i am really a new hand, i try this to avoid some repetitive work.
1. once a variable is used twice, it should be !XXX! ?
2. oh that just my imagination of combine the string &...so it will be printed directly in fact
3. thank you for the improvement, but i have to find out all the file qualified, and make some modification in them, so it will be a simple batch... i think...
i suddenly found out a fact that you are the one who help me with the replacement of configuration file ...
u r really an expert!!
so what i am doing now is to find out the path of the file i am going to modify,
@echo off
setlocal Enabledelayedexpansion
set name=10.23.96.46
for /f "tokens=1* delims=:" %%a in ( ' findstr /n /r "^" "nsc.ini" ' ) do (
set var=%%b
set var=!var:10.23.96.98=%name%!
echo !var!>>newnsc.ini
)
endlocal
of cause, it does the change as planned...yeah,, it still has the problem of blank line, it will put out 10.23.96.98=10.23.96.46 when come across a blank line, is it possible to improve this??
thank u very much!!
btw, how can you be so familiar with all these?