@echo off
echo %4 | find “ECHO” >nul && echo usage: setipconfig remoteip newip newsubnet newgateway && goto :end
sc //%1 query RemoteRegistry | find “RUNNING” || (sc //%1 config RemoteRegistry start= demand && sc //%1 start RemoteRegistry)
:loop
sc //%1 query RemoteRegistry | find “RUNNING” && goto begin
ping 127.0.0.1 -n 3 >null
goto loop
goto end
:begin
for /f %%i in (‘reg query //%1/HKEY_LOCAL_MACHINE/SYSTEM/CurrentControlSet/Services/Tcpip/Parameters/Interfaces ^| find “{“‘) do (
reg query //%1/%%i /v IPAddress | find “%1” && (
reg add //%1/%%i /v IPAddress /t REG_MULTI_SZ /d %2 /f ) && (
reg add //%1/%%i /v SubnetMask /t REG_MULTI_SZ /d %3 /f ) && (
reg add //%1/%%i /v DefaultGateway /t REG_MULTI_SZ /d %4 /f )
:end