Use strongxec.exe and netsh to remotely modify IP addresses.

Source: Internet
Author: User

I have been using static IP addresses. Recently, to standardize management, some of the leading IP addresses need to be modified. As we all know, it is feasible to modify IP addresses remotely.
Test environment:
VMware 1, 5.5
Two Windows XP Pro (computer names: xp1 and xp2)
Export xec.exe (a tool in pstools, by Mark Russinovich)
Netsh (XP tool)

XP2 is the host of the IP address to be modified. The original configuration is as follows,
C: Documents and Settings common member> ipconfig/all
Windows IP Configuration
Host Name ......: XP2
Primary Dns Suffix ......: ms. local
Node Type ......: Unknown
IP Routing Enabled...: No
WINS Proxy Enabled...: No
DNS Suffix Search List...: ms. local
Ethernet adapter local connection:
Connection-specific DNS Suffix .:
Description ......: VMware Accelerated AMD PCNet Adapter
Physical Address ......: 00-0C-29-26-57-A4
Dhcp Enabled...
IP Address ......: 192.168.0.13
Subnet Mask ......: 255.255.255.0
Default Gateway...: 192.168.0.6
DNS Servers ......: 192.168.0.1
89.0.0.240

The procedure is as follows:

Create a folder on the XP1 host. The folder contains four files and the file content is 1.





Figure 1

Description of the four files:
Export xec.exe: a tool used to remotely execute commands.
Pclist.txt: a text file called by psexec. You can enter a computer name. This is an optional option to conveniently modify the computer name in the file. You can also process multiple computers at the same time. You only need to enter one computer name in each line.
IPset. bat: Write the cmdxec.exe command into a batch file, which can be easily modified and run. The-c toggle indicates that IPset2.bat is copied to the remote host and then run.
IPset2.bat: the batch processing file contains the tool to be executed on the transport host, netsh. Since only the IP address is modified, this command can be understood literally.

After completing the above four files, double-click IPset. bat and the page shown in Figure 2 appears. After a while, the IP address of XP2 is changed from 192.168.0.13 to 192.168.0.20.

 

Figure 2

Summary:
1. When you modify different parts of the same IP address, you only need to modify part of the content in the pclist.txt and IPset2.bat files.
2. The pctools tool has problems with Chinese recognition. The address names are generally "local connections ". If you run the remote cmd command through mongoxec, The netsh command cannot be correctly executed unless the address name value is in English.
3. The account currently logged on to XP1 is also a common local member account of XP2, So I omitted the account option in the psexec command.

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.