Remote Batch modification of computer IP settings for batch file processing

Source: Internet
Author: User
Tags goto

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.

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.