1

Any help how can I turn on/off the software radio status on Windows 11? This is the status of my Wi-Fi:

Netsh WLAN show interfaces

There is 1 interface on the system:

    Name                   : Wi-Fi
    Description            : Killer Wireless-n/a/ac Wireless Network Adapter
    GUID                   : xx
    Physical address       : xx
    Interface type         : Primary
    State                  : disconnected
    Radio status           : Hardware On
                             Software Off

    Hosted network status  : Not available

This is the setting in Windows 11: enter image description here

I've tried the commands Enable-NetAdapter and Disable-NetAdapter, but those commands are for specific network interfaces, not for disabling of enabled WiFi broadly speaking.

Other users have suggested this command, however this does not enable or disable WiFi in software mode:

netsh interface set interface name="Wi-Fi" admin=DISABLED
Smeterlink
  • 652
  • 2
  • 11
  • 20
  • Try the accepted answer on this post: https://stackoverflow.com/questions/61930470/changing-radio-status-of-wi-fi-software-in-windows-10-via-command-prompt-or-powe. otherwise try the 2nd answer and see if that helps – Abraham Zinala Jan 10 '22 at 04:41
  • 1
    @AbrahamZinala perfect this is the exact solution!!! Improved below. – Smeterlink Jan 10 '22 at 09:45

1 Answers1

2

Solution is the same as proposed by @Diskoteket:

# Set-NetAdapterRadioPowerState.ps1
# credit to ben-n on superuser; adapted from https://superuser.com/a/1293303

[CmdletBinding()] Param (
    [Parameter(Mandatory=$true)][ValidateSet('Off', 'On')][string]$WifiStatus
)

Add-Type -AssemblyName System.Runtime.WindowsRuntime
$asTaskGeneric = ([System.WindowsRuntimeSystemExtensions].GetMethods() | ? { $_.Name -eq 'AsTask' -and $_.GetParameters().Count -eq 1 -and $_.GetParameters()[0].ParameterType.Name -eq 'IAsyncOperation`1' })[0]
Function Await($WinRtTask, $ResultType) {
    $asTask = $asTaskGeneric.MakeGenericMethod($ResultType)
    $netTask = $asTask.Invoke($null, @($WinRtTask))
    $netTask.Wait(-1) | Out-Null
    $netTask.Result
}
[Windows.Devices.Radios.Radio,Windows.System.Devices,ContentType=WindowsRuntime] | Out-Null
[Windows.Devices.Radios.RadioAccessStatus,Windows.System.Devices,ContentType=WindowsRuntime] | Out-Null
Await ([Windows.Devices.Radios.Radio]::RequestAccessAsync()) ([Windows.Devices.Radios.RadioAccessStatus]) | Out-Null
$radios = Await ([Windows.Devices.Radios.Radio]::GetRadiosAsync()) ([System.Collections.Generic.IReadOnlyList[Windows.Devices.Radios.Radio]])
$wifi = $radios | ? { $_.Kind -eq 'WiFi' }
[Windows.Devices.Radios.RadioState,Windows.System.Devices,ContentType=WindowsRuntime] | Out-Null
Await ($wifi.SetStateAsync($WifiStatus)) ([Windows.Devices.Radios.RadioAccessStatus]) | Out-Null

Then run it from powershell 5 (C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe), in my system version 5.1.22000.282.

Don't use powershell 7 (latest version now 7.2.1, location C:\Program Files\PowerShell\7\pwsh.exe) because doesn't work.

Result now after activation (not connected to any wifi because it's connected by RJ45 which is priority):

.\Set-NetAdapterRadioPowerState.ps1 -WifiStatus On
Netsh WLAN show interfaces

There is 1 interface on the system:

    Name                   : Wi-Fi
    Description            : Killer Wireless-n/a/ac Wireless Network Adapter
    GUID                   : xx
    Physical address       : xx
    Interface type         : Primary
    State                  : disconnected
    Radio status           : Hardware On
                             Software On

    Hosted network status  : Not available

Enable or disable with

.\Set-NetAdapterRadioPowerState.ps1 -WifiStatus On
.\Set-NetAdapterRadioPowerState.ps1 -WifiStatus Off

or if no arguments will ask.

Smeterlink
  • 652
  • 2
  • 11
  • 20