-1

To meet the constraints of my company, I must on a machine authorize only one active connection on a network. For this I need to control the activation or desactivation of wifi.

With netsh utility i can enable/disable physically the network card.

To display interface state :

netsh interface show interface "Wi-Fi"

To enable physically (with admin privilege) :

netsh interface set interface "Wi-Fi" admin=ENABLED

To disable physically (with admin privilege) :

netsh interface set interface "Wi-Fi" admin=DISABLED

On Windows we can enable/disable Wi-Fi logically. (Just click on network icone in task bar, then click on the wifi logo, the wifi interface is disabled.)

But with netsh it is not possible to enable/disable it logically. How can do it by CLI on Windows ?

Thank for your help.

Skacofonix
  • 19
  • 5

1 Answers1

1

I found a solution by changing a registry key. Using powershell in CLI prompt with admin privilege.

To display the wifi software status :

Get-NetAdapterAdvancedProperty -Name "Wi-Fi" -AllProperties -RegistryKeyword "SoftwareRadioOff"

To enable logically :

Set-NetAdapterAdvancedProperty -Name "Wi-Fi" -AllProperties -RegistryKeyword "SoftwareRadioOff" -RegistryValue "0"

To disable logically :

Set-NetAdapterAdvancedProperty -Name "Wi-Fi" -AllProperties -RegistryKeyword "SoftwareRadioOff" -RegistryValue "1"
Skacofonix
  • 19
  • 5