Modify IP address _dos/bat in DOS environment

Source: Internet
Author: User
Tags configuration settings
netsh interface ip dump >c:\pc1.txt

The command is to display the IP configuration of the interface of course "local connection" and save it in the Pc1.txt text file

I'll check the C:\pc1.txt file.

Displays the IP configuration of the current "Local Area Connection" interface, and we use the command Ipconfig/all to see if the current interface configuration is the same as the Pc1.txt file

You can see that the two are the same. We open PC1.TXT This file and change the IP 192.168.0.18 of "set address name =" Local Connection "source = static addr = 192.168.0.18" to 192.168.0.11 8, then save. Then, we use Notepad to create a new file, enter Netsh-f c:\pc1.txt.



--------------------------------------------------------------------------------------------------------------

DOS Modify the computer IP address 2006-08-22 19:59
The scripting features of Netsh are used to modify the IP address under CMD.

C:\netsh

C:\netsh>interface

C:\netsh\interface>ip

C:\netsh\interface\ip>dump (Display configuration)

Next, use Exit to exit the Netsh environment.

C:\>netsh-c Interface IP Dump >c:\interface.txt (you can export configuration scripts)

Then to edit it, in the resource manager, open Interface.txt, want to IP must be changed, Xixi.

The script should then be directed.

C:\>netsh-f c:\interface.txt (Import script)

The entire IP completion is changed at the command prompt.

After the repair of 2000, the original double-click can not start the phenomenon of service disappeared!

The Netsh command also has many powerful features as follows:

C:\>netsh

Netsh>?

The following instructions are valid:

Commands in this context:

...-move to the upper level of context.

? -Displays a list of commands.

AAAA-Change to ' aaaa ' context.

Abort-discards changes made in offline mode.

Add-Adds a configuration item to the project list.

Alias-Add an alias

Bye-quit the program.

Commit-commits the changes made in offline mode.

Delete-Deletes a configuration item on the list of items.

DHCP-Changes to the ' DHCP ' context.

Dump-Displays a configuration script.

EXEC-run a script file.

Exit-Exits the program.

Help-Displays a list of commands.

interface-Change to ' interface ' context.

Offline-Sets the current mode to offline.

Online-Sets the current mode to online.

POPD-Opens a context from the stack.

PUSHD-pushes the current context onto the stack.

Quit-Quit the program.

Ras-Change to ' RAS ' context.

Routing-Change to ' routing ' context.

Set-update configuration settings.

Show-Display information

Unalias-Deletes an alias.

WINS-Changes to the ' wins ' context.





----------------------------------------------------------------------------------------------

Modify IP at the command prompt

Run cmd
: >ipconfig (First use ipconfig this command to look at the IP address before the change)

Windows IP Configuration

Ethernet Adapter Local Area Connection:

Connection-specific DNS Suffix. :
IP address ...: 192.168.0.250 (IP prior to local connection change).
Subnet Mask ........... : 255.255.255.0
Default Gateway ..... . : 192.168.0.1

PPP Adapter dial-up Connections:

Connection-specific DNS Suffix. :
IP address. ...........:211.149.128.147
Subnet Mask ........... : 255.255.255.255
Default Gateway ..... . : 211.149.128.147

C:>netsh (then execute netsh this command)
Netsh>interface (subcommand for Netsh commands)
INTERFACE>IP (subcommand for interface command)
Interface Ip>set (subcommand for Interface IP command)

The following instructions are valid:

Commands in this context:
Set address-Sets the IP or default gateway for the specified interface.
Set DNS-sets the DNS server mode and address.
Set wins-sets the WINS server mode and address.
Interface Ip>set Address "Local Area Connection" static 192.168.0.2 255.255.255.0 192.168.0.1
1 (set IP address)
Are you sure.

Interface Ip>exit


C:>ipconfig (change and then use the ipconfig command to look at the IP address, confirm whether the change is successful)

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.