Disable/Enable Network Interface on Windows
Posted by Russell Wright on February 22, 2011
If you find that you need to disable and enable a network connection in a batch file, you can use the netsh command. I was having some issues of a network interface going “deaf” at times on one of my VMs and found that if I disabled the connection and enabled it and the problem would go away. I don’t like this solution, but in the short term, it’s going to have to do until I find the source of the problem.
netsh interface set interface "WAN Connection" disable
netsh interface set interface "WAN Connection" enable
The “WAN Connection” is the name of the connection in the network connections controls panel applet.