LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Access denied location services issue while running netsh wlan show net in labview

I am trying to detect a wifi by running in labview netsh wlan show net, but is giving this location service access denied error and on searching i found out this is an error associated with the latest windows. Is there a work around. Or is there any other way. I just need to detect a wifi signal , then connect to it and confirm the connection. Right now it is done using SSID. Is there a way to solve this problem or any other way to do this

0 Kudos
Message 1 of 3
(157 Views)

Windows blocks the action unless you enable location services. The logic is to prevent nefarious app makers doing background wifi scans to determine the user/victims location based on nearby SSIDs.

 

To make matters worse, under windows 11, the system doesn't do a complete wifi scan when you disable/enable the wlan programmatically.

This regularly causes a present SSID to be absent from the cashed list that "netsh wlan show..." delivers.

 

To make it work reliably you will also need to invoke a WlanScan function. https://learn.microsoft.com/en-us/windows/win32/api/wlanapi/nf-wlanapi-wlanscan

After this, the "netsh wlan show..." will return valid information.

 

A few hoops to jump through, but hope this helps.

 

0xDEAD.

 

 

0 Kudos
Message 2 of 3
(105 Views)

the location services is already turned on in my system and yet i get this error, i heard microsoft made it like that in windows 11

 

0 Kudos
Message 3 of 3
(98 Views)