Batch modify a command:
The code is as follows: |
Copy code |
For/l % I in (2, 1, 254) do 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 |
View the. bat file
The code is as follows: |
Copy code |
@ 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
|
Note that you must have the permission to use this file. Otherwise, you cannot operate it.