Activate or deactivate Wifi through commands - The Happy Android

In other blog posts we have talked about how to enable / disable wifi on Android scheduled or automated, but what about Windows? If you want activate or deactivate the wifi of your PC via commands, there are 2 ways - at least that I know of - to do it.

These options can be very useful when your laptop's Wi-Fi activation button is broken and not working, or you have a similar problem. To solve this you can create a small script by copying the code that we are going to comment on in a notepad and renaming the file extension from ".txt" to ".bat".

These two ways of managing the availability of the Wi-Fi receiver of our equipment are the following:

  • Enable / disable your computer's network adapter: Use this option when the Wifi button on your laptop does not work. A most useful method when the fault is hardware, but it only affects the physical button that activates the Wi-Fi signal of your computer.
  • Release / renew the IP of the equipment: When the Wi-Fi network adapter works correctly, but you want to cut the connection and / or re-establish it.

Enable / disable network adapter

To activate or deactivate the Wi-Fi signal through the network adapter, the first thing you have to do is know the name of the wireless network adapter. To do this, open the command console (right click on theBeginning ->Run, or open Cortana's search engine and type "cmd" without quotation marks). It is important, yes, that we open the terminal window with administrator permissions. Otherwise, the system will not let us make any changes.

Then type the following command line and hit enter:

netsh interface show interface

The first step is to identify the wireless network.

This command shows us both the Ethernet and wireless network adapters of the computer. Make a note of the interface name of the wireless network adapter. Usually it is the one called "Wi-Fi", you will see it right away.

Activate the adapter

To activate the adapter for your wireless connection and for the Wi-Fi receiver to re-detect the networks within your reach, copy the following command into a text file in your notepad:

netsh interface set interface Interface_name enabled

Replace "Name_of_Interface" by the name of your wireless connection, in the case of the mentioned example it would be:

netsh interface set interface Wi-Fi enabled

Save the file from the notepad, and once saved, replace the file extension from .txt to .bat

Change the extension to the text file

Whenever you want to activate the Wifi, it will be enough for you to execute this script. Of course, if all you need is to execute the command in a timely manner, you can simply open a cmd window with administrator permissions and launch the command "bareback".

If everything went well you should not see any message on the screen. If there is an error, the system will return a message indicating the problem that has prevented the order from being carried out.

Disable the adapter

To follow the reverse path, the steps to follow are practically identical. Open a notepad and copy this other command to disable the adapter:

netsh interface set interface Interface_name disabled

Replace "Interface_name" with the name of your wireless connection. In the case of the example screenshot, the order to be entered would be the following:

 netsh interface set interface «Wi-Fi» disabled

Save the notepad file, and once saved replace the text file extension from .txt to .bat

Convert the txt to an executable file

Whenever you want to disable Wi-Fi, just run this script. Of course, we can also open a cmd window with administrator permissions and launch the command whenever we need it.

Release / renew the IP of the equipment

Another way to disconnect the Wifi is by releasing the IP assigned to your PC, and reassigning a new IP address in case you want to connect it to the network again.

In this case, the commands to execute would be the following:

Release IP:

Ipconfig / release

Assign new IP address:

Ipconfig / renew

The drawback of executing these commands is that if you have a dynamic IP when you assign a new IP to your computer, it could change. In certain cases this can be inconvenient.

What if none of this works?

If you have reached this post because the WiFi activation button is faulty and none of these methods works for you, it would be convenient to consider the possibility that your laptop's own wireless network adapter is faulty.

In this case, if you don't want to break your head, you can opt for the simplest solution: get a nano usb network adapter. They are extremely small, very easy to use and are not worth more than 6 or 7 euros (slightly less than $ 7-$ 8). I leave you here a little review of one of these adapters, and a direct link to Amazon if you are already convinced and want to buy it and test its effectiveness first hand. I had to get one of them (TP-LINK's TL-WN725N from the review I am telling you about) and the truth is that I was delighted. Seriously, take a look at the photos, it's really tiny!

If you found this post interesting and / or it has helped you to solve your problem, I would be very grateful if you would help me spread it on your social networks. So now you know, friend: thank you, see you next time and ... Share it!

You have Telegram installed? Receive the best post of each day on our channel. Or if you prefer, find out everything from our Facebook page.

Recent Posts

$config[zx-auto] not found$config[zx-overlay] not found