Netsh is an MS-DOS command that enables users to change network settings. For example. users may switch their network device from a dynamic address to a static address or changing the IP address.
Availability
Netsh is an external command accessed through C:\Winnt\System32 directory and is available for the following Microsoft operating systems as netsh.exe.
Availability
Netsh syntax
Netsh examples
Windows 2000
Windows XP
Windows Vista
Windows 7
Windows 8
Windows 10
Windows 11
Netsh syntax
Windows Vista and later syntax
netsh [-a AliasFile] [-c Context] [-r RemoteMachine] [-u [DomainName]UserName] [-p Password | *] [Command | -f ScriptFile]
The following commands are available:
- Windows Vista and later syntax.
- Windows XP and earlier syntax.
Windows XP and earlier syntax
netsh [-a AliasFile] [-c Context] [-r RemoteMachine] [Command | -f ScriptFile]
Available commands after you have entered the netsh command (typing netsh at the prompt and pressing Enter).
Netsh examples
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 at the prompt. 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 address.
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
Related information
- See our network definition for further information and related links on this term.