I want that when I press f1 hotkey then it should disable (disconnect) Wireless Network Connection in network and sharing center which exists in control panel. If I again press f1 key then it should enable (connect) Wireless Network Connection in network and sharing center existing in control panel. I am using windows 7, 32 bit.
please look at these screen shot-
I searched the forum for getting the help for the same. I found following links-
https://autohotkey.com/board/topic/1289 ... rk-switch/
https://autohotkey.com/board/topic/1722 ... ntry372132
in the above links i found these codes-
Code: Select all
f1::
c:=!c ; toggle c between 1 or 0
if !c
soundbeep ;warn when off
netconnect() ; set c to 1 or 0 to switch on off
return
NetConnect(bEnable := False, sConnection := "Wireless Network Connection") { ; for AHK v1.1+
For oConn In ComObjCreate("Shell.Application").Namespace(0x0031).Items
If oConn.Name = sConnection {
If InStr(oConn.Verbs.Item(0).Name, bEnable ? "&a" : "&b")
oConn.Verbs.Item(0).DoIt
Break
}
}
return