- @echo off
- setlocal enabledelayedexpansion
- set fileName=config.ini
- set /p ip=10.0.0.
- (for /f "tokens=1*,delims=:" %%h in('findstr /n . "%fileName%"') do (
- set "ipAddress=%%i"
- if "!ipAddress:address=!" neq "%%i" (
- echo address=10.0.0.%ip%
- ) else (
- echo,%%i
- )
- ))>%fileName%.temp
- move /y %fileName%.temp %fileName%
- pause
复制代码
|