This article shows how to disable/enable Wireless network connection(WiFi) on a windows system from command line. We can also find the status of network connections, check if they are connected or disconnected.
Disable WiFi from command prompt
Open elevated administrator command prompt and run the below command to turn off WiFi
netsh interface set interface name="Wireless Network Connection" admin=DISABLED
After running the command, you can immediately see in System tray (Right bottom corner on your windows screen) that WiFi is disconnected. In network connections, it shows it as disabled.
How to enable WiFi connection
Run the below netsh command to turn on Wifi connection from command line.
netsh interface set interface name="Wireless Network Connection" admin=ENABLED
How to disconnect Wifi connection
If you don’t want to disable WiFi interface on your computer, but only disconnect from a specific WiFi network, then run the below command.
netsh wlan disconnect
This does not turn off Wifi interface on the computer.
Connect to Wifi network from CMD
Run the below command to connect to a specifi WiFi network
netsh wlan connect name="WifiNetWorkName"
This command needs to be run from elevated command prompt to make any changes to the network connection configuration. Running from normal command prompt throws up error as below.
C:\>netsh interface set interface name="Wireless Network Connection" admin=DISABLED An interface with this name is not registered with the router.