Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Enable/disable network connection from command line

Tags:

I know that there exists ton of results in Google for this: results, but I didn't make it in my Windows XP machine. I want to disable LAN connection from command line.

>netsh interface set interface "Local Area Connection" DISABLED One or more essential parameters not specified The syntax supplied for this command is not valid. Check help for the correct sy ntax.  >netsh interface set interface name="Local Area Connection" admin="disabled" One or more essential parameters not specified The syntax supplied for this command is not valid. Check help for the correct sy ntax.  >netsh interface set interface name="Local Area Connection" admin=DISABLED One or more essential parameters not specified The syntax supplied for this command is not valid. Check help for the correct sy ntax. 
like image 478
trante Avatar asked Nov 07 '13 08:11

trante


People also ask

How do I enable network disabled?

Go to Start > Control Panel > Network and Internet > Network and Sharing Center. In the left-hand column, click Change adapter settings. A new screen will open with a list of network connections. Right-click Local Area Connection or Wireless Connection and select Disable.

How do I enable network connection?

Turn it off to enable the wireless network card if it's turned on. The Wi-Fi adapter can also be enabled in the Control Panel. Click the Network and Sharing Center option, then click the Change adapter settings link in the left navigation pane. Right-click the Wi-Fi adapter and select Enable.

How do I disable and enable network adapter remotely?

Open the “Device Manager”: one of the ways is to execute in the search bar or in the menu (Run is called with the Win + R keys) enter the command devmgmt. msc and press the Enter key. To disable the network connection: open “Network adapters”, right-click on the one you want to disable, and click on “Disable device”.


1 Answers

For the first two commands, you need elevated/ administrator rights:

Disable the LAN network connection

C:\> netsh interface set interface name="Local Area Connection" admin=disabled 

Enable the LAN network connection

C:\> netsh interface set interface name="Local Area Connection" admin=enabled 

assumption : your interface was named as "Local Area Connection" else substitute proper name. Use netsh interface show interface to find the name.

List Wifi profiles

C:\> netsh wlan show profiles 

Connect to Wifi profile

C:\> netsh wlan connect name="ProfileName" 
like image 185
Yarish Kumar Avatar answered Oct 15 '22 21:10

Yarish Kumar