Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Possible Duplicate:
Enable/disable wireless interface in a bat file

I need to create a hotkey that essentially instantly turns off my wireless radio card (whatever it is called), and either reconnects automatically, after a set amount of time, when pressed again OR when I press a different key.

When I press F12, will dissconnect me from the internet, then when I press F11 (or F12) it will reconnect.

After a little research I have come up with ways such as WinX, which opens Mobility centre, but that is not automatic as I still have to press "Turn Wireless Off", I am looking for a key that simply turns it on and off, as found on a lot of laptops.

Some code I found included:

SetTitleMatchMode, 2
#z::
 Run %windir%\system32\mblctr.exe /open
 WinWait, Windows Mobility Center
 Sleep, 300
 Send, !t
 Sleep, 1000
 WinClose, A
 Return

But this includes Mobility Centre again.

share|improve this question

marked as duplicate by Karan, sudo, 8088, Simon Sheehan, Canadian Luke Jan 24 '13 at 23:24

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

    
Am I assuming correctly that the real problem is that you're having troubles connecting to a certain WiFi and need to restart your wireless adapter for it to work? –  slhck Jan 22 '13 at 10:07
    
Maybe this question could be of help to you: Enable/disable wireless interface in a bat file –  bigbadonk420 Jan 22 '13 at 10:26
    
MM i need some sort of hotkey to toggle it, not to do it through the command line, it has to be in rapid sucsession while i have a full screan program open. –  user191844 Jan 22 '13 at 11:52
    
@slhck i am not having problems connecting to a cirtain wifi, i am trying to toggle it while in a full screan program on a server to connect and kind of "half disconnect", when i lose connection it waits 30 seconds before kicking me, if i can turn it off then on in under 30 seconds (with a hotkey), i will be able to acheive what i want to do. –  user191844 Jan 22 '13 at 12:00

1 Answer 1

Solved it.

netsh interface set interface name="Wireless Network Connection" admin = disabled  
netsh interface set interface name="Wireless Network Connection" admin = enabled  

The first line disables it, the second enables it! Thanks for the comments.

share|improve this answer

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