I'm using netsh to enable an hostednetwork AP and it works fine, but i wanted to make a step forward and try to query and enable the wifi adapter. Then the problem - if wifi toggle is switched off it won't work. -> what do i mean for wifi toggle switch - also if you try to hardly reboot the device.

this is an example of the batch i tried to use from admin:

  • @echo off
  • netsh interface set interface "Wi-Fi" enable
  • netsh wlan set hostednetwork mode=allow ssid=netshfirsttake key=12345678
  • netsh wlan start hostednetwork
  • exit

but it seem to act as hard switch, probably like disabling it from the device manager. So i definitely I cannot figure out how to activate that switch with a batch.

Is it possible to automate this kind of script via batch? Or I'm just dreaming?

Thanks for your time and help.


  • thanks, i looked at it but the problem remains because: 1. case 1 - switch already ON -> using netsh and wmic functions to disable and enable the adapter works. 2. case 2 - switch OFF -> using both of the above functions to enable do not make the switch turn ON
    – mimmus
    Oct 29, 2015 at 12:13
  • You may be able to do this on a specific laptop but there's no standard way of doing it on different laptops.
    – qasdfdsaq
    Oct 29, 2015 at 12:34

1 Answer 1


I believe you have to get in touch with the manufacturer because it seems two pieces of good keyboard management software don't even know how to interpret the Keyboard scan code for the WiFi switch. You might try function F2 and the button.

  • thanks, i tried this one too but problem remains. fn+f2 works as airplane mode switch (turn on and off any radio communication stream). wireless switch still keeps its value (ON-OFF) after that command.
    – mimmus
    Oct 29, 2015 at 12:22

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.