Devils0411, через WMI - без замены, но с добавлением в конец:
Код:
@Echo On
Set WSIF=C:\TEST\winnt.sif
For /F "Tokens=2 Delims=={,} " %%i In ('WMIC NICCONFIG Where IPEnabled^=True Get IPAddress /Value^') Do Set $IP=%%~i
For /F "Tokens=2 Delims==" %%i In ('FindStr /IB "OriSrc=" "%WSIF%"') Do For /F "Tokens=1* Delims=\" %%a In (%%i) Do Set $V="\\%$IP%\%%b"
FindStr /VIB "OriSrc=" "%WSIF%" >"%TEMP%\%~n0.tmp"
Echo.>>"%TEMP%\%~n0.tmp"
Echo [data]>>"%TEMP%\%~n0.tmp"
Echo OriSrc=%$V%>>"%TEMP%\%~n0.tmp"
If Exist "%TEMP%\%~n0.tmp" Copy /Y "%TEMP%\%~n0.tmp" "%WSIF%"