Microsoft DOS netsh command
Quick links
About netsh
Availability
Syntax
Examples
MS-DOS command that enables users to change network settings such as changing their network device from a dynamic address to a static address or changing the IP address.
The netsh.exe command is an external command accessed through C:\Winnt\System32 directory and is available in the below Microsoft operating systems.
Windows 2000
Windows XP
Windows Vista
Windows 7
netsh [-a AliasFile] [-c Context] [-r RemoteMachine] [Command | -f ScriptFile]
| ? | Displays a list of commands. | ||||||||||
| add | Adds a configuration entry to a list of entries.
|
||||||||||
| delete | Deletes a configuration entry from a list of entries.
|
||||||||||
| dump | Displays a configuration script. | ||||||||||
| exec | Runs a script file. | ||||||||||
| help | Displays a list of commands. | ||||||||||
| interface | Changes to the `interface' context.
|
||||||||||
| ras | Changes to the `ras' context.
|
||||||||||
| routing | Changes to the `routing' context.
|
||||||||||
| set | Updates configuration settings.
|
||||||||||
| show | Displays information.
|
Available commands after you have entered the netsh command (typing netsh at the prompt and pressing enter).
| .. | Goes up one context level. |
| ? | Displays a list of commands. |
| abort | Discards changes made while in offline mode. |
| add | Adds a configuration entry to a list of entries. |
| alias | Adds an alias. |
| bye | Exits the program. |
| commit | Commits changes made while in offline mode. |
| delete | Deletes a configuration entry from a list of entries. |
| dump | Displays a configuration script. |
| exec | Runs a script file. |
| exit | Exits the program. |
| help | Displays a list of commands. |
| interface | Changes to the `interface' context. |
| offline | Sets the current mode to offline. |
| online | Sets the current mode to online. |
| popd | Pops a context from the stack. |
| pushd | Pushes current context on stack. |
| quit | Exits the program. |
| ras | Changes to the `ras' context. |
| routing | Changes to the `routing' context. |
| set | Updates configuration settings. |
| show | Displays information. |
| unalias | Deletes an alias. |
netsh
Enter the netsh command.
netsh dump
Dump all the network information as a script to the screen. Can also be sent to a file by doing netsh dump > file.txt . This script can then be executed using the exec command.
set address name="Local Area Connection" source=dhcp
Set the "Local Area Connection" to DHCP.
set address local static 10.0.0.9 255.0.0.0 10.0.0.1 1
Set the local address to Static.
netsh interface ip show config
View network ip configuration. Below is an example of what may be seen.
Configuration for interface "Local Area Connection"
DHCP enabled: Yes
InterfaceMetric: 1
DNS servers configured through DHCP
WINS servers configured through DHCP
