Batch processing for remote bulk modification of computer IP settings _dos/bat

Source: Internet
Author: User
Tags goto administrator password
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
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.