Network IP Settings Remote change script.
When the network rectification requires a large number of IP changes, you can use the script to make changes (not effective before restarting the computer, you can continue to work), and so on time to modify the switch configuration, the next day after all the computer startup can use the new IP work.
Prerequisites, knowing the domain administrator password or the native administrator password for all computers (which is troublesome), the client computer is Win2K or XP (firewall open 135~139 port).
A command batch modification:
For/l%i in (2,1,254) does net use//192.168.0.%i/user:admin@domain.com "password" && setipconfig 192.168.0.%i 10. 0.0.%%i 255.255.255.0 10.0.0.1
Setipconfig.bat contents are as follows:
Copy Code code as follows:
@echo off
echo%4 | find "echo" >nul && Echo usage:setipconf IG 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 >nu ll
Goto Loop
Goto end
: Begin
For/f%%i in (' REG query//%1/hkey_local_machine/s Ystem/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