Monday 5 August 2019

networking - Enable/disable wireless interface in a bat file


Is there a way to enable/disable a wireless network interface via the command line (so I can put it in a bat file)?


When I'm in the office I use a wired connection, but Windows still occasionally bugs me about my wireless connection not being connected (even though I turned off the option for notifying me when there's no connectivity). I'm guessing the only way to stop it from bugging me is to disable the interface, but I'd rather not have to go into the network settings every time I need to do so.


I'd like to set up a bat file or a shortcut that I can use to enable/disable the wireless (preferably a single one that toggles the current state), and then just set up a keyboard shortcut for that. I just have no idea how to do so from the command line.



Answer




I'd like to set up a bat file or a shortcut that I can use to enable/disable the wireless



Use Microsoft DevCon ...



The DevCon utility is a command-line utility that acts as an alternative to Device Manager. Using DevCon, you can enable, disable, restart, update, remove, and query individual devices or groups of devices. DevCon also provides information that is relevant to the driver developer and is not available in Device Manager.



And here's tutorial for you:


Enable/Disable Wireless Card from Command Line



preferably a single one that toggles the current state



You'll need two batch files, one for WiFi Off and one for WiFi On.


Having said that, i assume you're using a laptop. Are you sure your Laptop doesn't allow to toggle WLAN on/off via a Fn key combo or a physical switch? Can you post make and model?


No comments:

Post a Comment

How can I VLOOKUP in multiple Excel documents?

I am trying to VLOOKUP reference data with around 400 seperate Excel files. Is it possible to do this in a quick way rather than doing it m...