回复 2# ygqiang
这样比较简洁- @echo off
- setlocal enabledelayedexpansion
- (for /f "tokens=1* delims=:" %%h in ('findstr /n "." "1.ini"') do (
- set "str=%%i"
- if "!str:SourcePath=!" neq "%%i" (
- echo SourcePath=C:\Windows
- ) else if "!str:NeedUpdatePath=!" neq "%%i" (
- echo NeedUpdatePath=C:\Windows
- ) else (
- echo,%%i
- )
- ))>"2.ini"
复制代码
|