Jump to content

Recommended Posts

Posted

I'd like to detect if there is a wifi interface available and if this wifi interface is 5Ghz or 2.4Ghz . Any suggestions?

 

  • Moderators
Posted

Probably the easiest way:

Run(@ComSpec & " /k " & "netsh wlan show drivers")

If the radio type supported shows N or A/C it is a good bet it supports 5GHz

I would think you could do it from WMI as well, something like this (pseudo):

$wbemFlagReturnImmediately = 0x10
$wbemFlagForwardOnly = 0x20
$oWMI = ObjGet("winmgmts:\\.\root\cimv2")
$oItems = $oWMI.ExecQuery("SELECT * FROM Win32_NetworkAdapter", "WQL", $wbemFlagReturnImmediately + $wbemFlagForwardOnly)
   For $item In $oItems
      ConsoleWrite("Caption: " & $item.Caption & ", Max Speed of: " & $item.MaxSpeed & @CRLF)
   Next

I can't test at the moment, but you may be able to use the MaxSpeed parameter to determine what bands you have access to.

"Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball

How to get your question answered on this forum!

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...