10 Most useful Netsh network commands on Windows

Going a little on the technician, we discover one of the most important Windows commands to manage network settings without additional programs and without using options windows.
This is the netsh command, which allows you to do a whole series of operations from the dos prompt and which knowing can really make it easier to solve problems with the internet, assign ip addresses and configure parameters.
To launch netsh, just open a DOS command prompt window (from the Start menu or in Windows 10 and 8 by pressing the right mouse button on the Start button) and then write, in fact, the word netsh and press Enter.
To use this tool you must choose the command prompt with administrator rights .
Taken on its own, the netsh command does nothing but open access to network tools and to know what they are you need to run the help command.
To facilitate the article we will see the main and most useful ways of using netsh, writing the commands to be run on the dos prompt directly, without therefore entering netsh mode first.
There are at least 10 types of commands that can be executed via netsh, which are really worth knowing and using in order to do some operations that are sometimes vital or really useful in certain circumstances.
1) To reset the network and resolve any connection problems
From the dos prompt, run the command:
netsh int ip reset resettcpip.txt
And then the command:
netsh winsock reset
In this way the network is completely reset and any configuration error is corrected.
The txt file is used simply to record the outcome of the operation.
2) To see nearby wifi and details
You can see the names and other details of the wifi networks detected by our PC with the command:
netsh wlan show networks mode = bssid
3) See the password of the wifi network on Windows
As already explained in the past, you can use the netsh command on any Windows PC to find out the password used to access the wifi network, if forgotten or even if you are using another person's computer.
For this purpose two commands must be executed:
The first to see the names of the stored wifi connections
netsh wlan show profile
The second to see the password of one of the connections:
netsh wlan show profile name = NAME key = clear
Changing where NAME is written with the name of the wifi network to be discovered.
4) Set static or dynamic IP
To change static IP address to your computer you can use a simple netsh command such as:
netsh interface ip set address name = "Connection to the local network (LAN)" source = static addr = 192.168.0.10 mask = 255.255.255.0 gateway = 192.168.0.1
This command sets IP 192.168.0.10 to the computer also specifying the subnetmask and gateway parameters.
The connection name must be changed according to the one used.
To find out the name of the connection in use, use the command:
netsh interface ip show config
To set up DHCP, i.e. the automatic assignment of the IP address, the command is:
netsh interface ip set address name = "Connection to the local area network (LAN)" source = dhcp
5) Set up the DNS servers
With commands similar to those seen above, DNS servers can be set manually and, for example, Google DNS can be used.
The command for primary DNS is:
netsh interface ip set dns "Local Area Connection (LAN)" static 8.8.8.8 primary
For secondary DNS it is:
netsh interface ip add dns "Local Area Connection (LAN)" 8.8.4.4 index = 2
Always remember to change the name of the "connection to the local LAN" as seen in the previous point.
6) Use the PC as a router
Through netsh you can turn Windows 10 into a wifi router or use your Windows 7 or 8.1 PC as an access point.
In practice, if the computer is connected to the internet via cable, it can be used to create a wifi connection and also connect smartphones and other devices to the internet.
Regarding this I have already explained everything, however it is, the command to activate the wifi network and the Windows router functions is:
netsh wlan set hostednetwork mode = allow ssid = navigaweb key = my-password keyUsage = persistent
Change ssid and key as you wish.
Then run the command:
netsh wlan start hostednetwork
7) Netsh to improve internet connection
In the guide with the tricks to speed up the internet connection we used the netsh command three times.
The first time, to activate Compound TCP by running:
netsh int tcp set global congestionprovider = ctcp
The second time to activate Direct Cache Access with:
netsh int tcp set global dca = enabled
The third time to minimize the network card's CPU usage:
netsh int tcp set global chimney = enabled
However, look at the guide before using these controls.
8) Disable autotuning which can slow down the internet
In another article we saw some options that limit internet bandwidth to be disabled in Windows.
One of these is autotuning which can be deactivated using the command:
netsh int tcp set global autotuninglevel = disabled
9) Deactivate the network card and disconnect the PC
To disconnect from the internet and the network quickly, just this command:
netsh interface set interface "network connection name" disabled
For the name of the network connection, see point 2 above.
To reactivate the network:
netsh interface set interface "connection name" enabled
10) Set up an internet proxy
In some cases it may be required to set up a proxy to surf the internet from Internet Explorer, Firefox and Chrome.
In Windows 10 and Windows 8.1, if you want apps to use that proxy, you need to use netsh with the following commands:
netsh winhttp show proxy to see if there is a proxy set and then
netsh winhttp import proxy source = ie
11) Hide and block unused Wifi networks on PC
This can be done using the netsh command
There are many other ways to use netsh, so for those who want to learn more, refer to the official guide on the Microsoft site.

Leave Your Comment

Please enter your comment!
Please enter your name here