Jump to content
Sign in to follow this  
ACalcutt

Getting avalible wireless networks in XP

Recommended Posts

ACalcutt

Hello everyone,

I am trying to make my vistumbler application(http://techidiots.net/project-pages/vistumbler/) also compatible with XP. Does anyone know how I can get availible network data in XP? In vista I am using netsh, but 'netsh wlan show networks mode=bssid' is not avalible in xp. I am lookin for another source I can use in xp, be it WMI, COM, or DLL, random exe file.


Andrew Calcutt

Http://www.Vistumbler.net

Http://www.TechIdiots.net

Its not an error, its a undocumented feature

Share this post


Link to post
Share on other sites
weaponx

Man I can't find crap for viewing available wireless networks from the command line, not even 3rd party. The best I could find is this MS Support article offering a Wireless Zero API:

http://support.microsoft.com/kb/918997

EDIT: MSDN API usage for Native WiFi http://msdn2.microsoft.com/en-us/library/ms706556.aspx

I'm not good with Dllcall so hopefully someone else checks this out.

Here is the info from MSDN:

The Native Wifi API sample demonstrates the use of basic wireless network management functions. The source code for the sample can be found in the SDK installation location under C:\Program Files\Microsoft SDKs\Windows\v6.0\Samples\NetDs\Wlan\AutoConfig.

The Native Wifi sample can be compiled and run on both Windows Vista and Wireless LAN API for Windows XP SP2. Some features of the sample are not supported on Wireless LAN API for Windows XP SP2. For a list of functions supported by Wireless LAN API for Windows XP SP2, see About the Native Wifi API.

The Native Wifi sample demonstrates how to perform the following tasks:

Edited by weaponx

Share this post


Link to post
Share on other sites
ACalcutt

Man I can't find crap for viewing available wireless networks from the command line, not even 3rd party. The best I could find is this MS Support article offering a Wireless Zero API:

http://support.microsoft.com/kb/918997

EDIT: MSDN API usage for Native WiFi http://msdn2.microsoft.com/en-us/library/ms706556.aspx

I'm not good with Dllcall so hopefully someone else checks this out.

Here is the info from MSDN:

Ya, I saw that but i have no idea how to use it. I am not good with dll calls yet either, and all the example I find are in C# so i don't even know where to start with that

I also found this (http://msdn2.microsoft.com/en-us/library/aa916566.aspx), but microsoft un-helpfully says to refer to the sourse code for more documetation. It seems "WZC_VISIBLE_NETWORK" may do what i need, but their explanation of ReadMsgQueue (the command needed to get this information) is not enough


Andrew Calcutt

Http://www.Vistumbler.net

Http://www.TechIdiots.net

Its not an error, its a undocumented feature

Share this post


Link to post
Share on other sites
ptrex

@all

You can start exploring the WMI interface for your Wireless AP.

$strComputer = "." 

$objWMIService = ObjGet("winmgmts:\\" & $strComputer & "\root\WMI") 

$colItems = $objWMIService.ExecQuery("SELECT * FROM MSNdis_80211_BSSIList") 
For $objItem in $colItems 
    Consolewrite ( "-----------------------------------" & @CRLF)
    Consolewrite ( "MSNdis_80211_BSSIList instance" & @CRLF)
    Consolewrite ( "-----------------------------------" & @CRLF)
    Consolewrite ( "Active: " & $objItem.Active & @CRLF)
    Consolewrite ( "InstanceName: " & $objItem.InstanceName & @CRLF)
    If Not IsObj($objItem.Ndis80211BSSIList) Then 
        Consolewrite ( "Ndis80211BSSIList: " & @CRLF)
    Else
        Consolewrite ( "Ndis80211BSSIList: " & ($objItem.Ndis80211BSSIList & @CRLF)) 
    EndIf
    Consolewrite ( "NumberOfItems: " & $objItem.NumberOfItems & @CRLF)
Next

If you google you will find more properties that can be queried.

But of cource it depends on what your AP exposes to the WMI interface

regards,

ptrex

Share this post


Link to post
Share on other sites
ptrex

@all

You can start exploring the WMI interface for your Wireless AP.

$strComputer = "." 

$objWMIService = ObjGet("winmgmts:\\" & $strComputer & "\root\WMI") 

$colItems = $objWMIService.ExecQuery("SELECT * FROM MSNdis_80211_BSSIList") 
For $objItem in $colItems 
    Consolewrite ( "-----------------------------------" & @CRLF)
    Consolewrite ( "MSNdis_80211_BSSIList instance" & @CRLF)
    Consolewrite ( "-----------------------------------" & @CRLF)
    Consolewrite ( "Active: " & $objItem.Active & @CRLF)
    Consolewrite ( "InstanceName: " & $objItem.InstanceName & @CRLF)
    If Not IsObj($objItem.Ndis80211BSSIList) Then 
        Consolewrite ( "Ndis80211BSSIList: " & @CRLF)
    Else
        Consolewrite ( "Ndis80211BSSIList: " & ($objItem.Ndis80211BSSIList & @CRLF)) 
    EndIf
    Consolewrite ( "NumberOfItems: " & $objItem.NumberOfItems & @CRLF)
Next

If you google : WMI and MSNdis_80211 , you will find more properties that can be queried.

But of cource it depends on what your AP exposes to theWMI interface

regards,

ptrex

Edited by ptrex

Share this post


Link to post
Share on other sites
ACalcutt

@all

You can start exploring the WMI interface for your Wireless AP.

$strComputer = "." 

$objWMIService = ObjGet("winmgmts:\\" & $strComputer & "\root\WMI") 

$colItems = $objWMIService.ExecQuery("SELECT * FROM MSNdis_80211_BSSIList") 
For $objItem in $colItems 
    Consolewrite ( "-----------------------------------" & @CRLF)
    Consolewrite ( "MSNdis_80211_BSSIList instance" & @CRLF)
    Consolewrite ( "-----------------------------------" & @CRLF)
    Consolewrite ( "Active: " & $objItem.Active & @CRLF)
    Consolewrite ( "InstanceName: " & $objItem.InstanceName & @CRLF)
    If Not IsObj($objItem.Ndis80211BSSIList) Then 
        Consolewrite ( "Ndis80211BSSIList: " & @CRLF)
    Else
        Consolewrite ( "Ndis80211BSSIList: " & ($objItem.Ndis80211BSSIList & @CRLF)) 
    EndIf
    Consolewrite ( "NumberOfItems: " & $objItem.NumberOfItems & @CRLF)
Next

If you google : WMI and MSNdis_80211 , you will find more properties that can be queried.

But of cource it depends on what your AP exposes to theWMI interface

regards,

ptrex

That script didn't seem to do anything, even when I ran it from the command prompt. (on XP or Vista.). But I was already looking at that though WMI with the WMI scriptomatic, but i didn't find what I was looking for(all that does is show local wireless device names and the other MSNdis_80211 entries don't seem like what I need either). Edited by ACalcutt

Andrew Calcutt

Http://www.Vistumbler.net

Http://www.TechIdiots.net

Its not an error, its a undocumented feature

Share this post


Link to post
Share on other sites
ptrex

@all

But this does :)

$objSWbemServices = ObjGet("winmgmts:\\.\root\wmi") 
$colInstances = $objSwbemServices.ExecQuery("SELECT * FROM MSNDis_80211_BSSIList") 
for $obj in $colInstances 
if StringLeft($obj.InstanceName, 4) <> "WAN " and StringRight($obj.InstanceName, 8) <> "Miniport" then 
for $rawssid in $obj.Ndis80211BSSIList 
    $ssid = "" 
    for $i=0 to ubound($rawssid.Ndis80211SSid) 
    $decval = $rawssid.Ndis80211Ssid($i) 
        if ($decval > 31 AND $decval < 127) then 
        $ssid = $ssid & Chr($decval) 
        endif 
    next 
    ConsoleWrite($ssid & @CRLF)
next 
endif 
next

Did you bother to google ?

regards,

ptrex

Share this post


Link to post
Share on other sites
ACalcutt

Did you bother to google ?

regards,

ptrex

I've been googling since before i posted this yesterday :-)

Looking at your code I notice its similar to this code i tried ( http://www.mp3car.com/vbulletin/software-s...eless-code.html ), but was not able to get to work.

Yours does seem to work, even though I still don't understand it, i will see if i can get the other information I am trying to get.

BTW....how do I view information being writen by ConsolWrite, I had to change it to a msgbox just to see the output

Edited by ACalcutt

Andrew Calcutt

Http://www.Vistumbler.net

Http://www.TechIdiots.net

Its not an error, its a undocumented feature

Share this post


Link to post
Share on other sites
ElCamino

I've been googling since before i posted this yesterday :-)

Looking at your code I notice its similar to this code i tried ( http://www.mp3car.com/vbulletin/software-s...eless-code.html ), but was not able to get to work.

Yours does seem to work, even though I still don't understand it, i will see if i can get the other information I am trying to get.

BTW....how do I view information being writen by ConsolWrite, I had to change it to a msgbox just to see the output

seems that you know about mp3car, are you a member also?, i wrote a plugin for road runner, using the wmi to get the wireless connection info. to see whats been writen to the console, just hit the {F5} key while in the editor, and all the output info will be shown in the bottom, youl see.

Share this post


Link to post
Share on other sites
MadBoy

BTW....how do I view information being writen by ConsolWrite, I had to change it to a msgbox just to see the output

You can see that in SciTE editor. When you run script in it with F5 or ALT-F5 (for beta). Go to main page of AutoIt there's a JDEB version that has all the naughty and great features for AutoIt :)


My little company: Evotec (PL version: Evotec)

Share this post


Link to post
Share on other sites
ptrex

@ACalcutt

Good to know it is working.

But if you don't use the SciTE editor yet.

YOU SHOULD STOP USING AUTOIT right know before doing anything else.

First start taking the time to get used to using the SciTE editor. This will save you a lot of headackes !!

regards

ptrex

Share this post


Link to post
Share on other sites
ACalcutt

@ACalcutt

Good to know it is working.

But if you don't use the SciTE editor yet.

YOU SHOULD STOP USING AUTOIT right know before doing anything else.

First start taking the time to get used to using the SciTE editor. This will save you a lot of headackes !!

regards

ptrex

What better way to learn to use it than to actually use it!.....stop using autoit...no way ;-). I do use scite though, I had just never used a Consolewrite before

Madboy, thanks for the explanation

Edited by ACalcutt

Andrew Calcutt

Http://www.Vistumbler.net

Http://www.TechIdiots.net

Its not an error, its a undocumented feature

Share this post


Link to post
Share on other sites
ACalcutt

seems that you know about mp3car, are you a member also?, i wrote a plugin for road runner, using the wmi to get the wireless connection info. to see whats been writen to the console, just hit the {F5} key while in the editor, and all the output info will be shown in the bottom, youl see.

No, I'm not a member, I just came across that when I was searching


Andrew Calcutt

Http://www.Vistumbler.net

Http://www.TechIdiots.net

Its not an error, its a undocumented feature

Share this post


Link to post
Share on other sites
ptrex
Skizmata

I am in great need of a way to discover my SSID in AutoIt. But ptrex example is not working for me. I'm thinking its because the wifi is controled by the Dell Wireless Utility not windows built in. Any idea where to go from here? Unfortunatlly I cant really change the way the wifi is setup on the laptop's this project is ment for. Any help would be awesome!

ptrex code,

$objSWbemServices = ObjGet("winmgmts:\\.\root\wmi")
$colInstances = $objSWbemServices.ExecQuery("SELECT * FROM MSNDis_80211_BSSIList")
For $obj In $colInstances
    If StringLeft($obj.InstanceName, 4) <> "WAN " And StringRight($obj.InstanceName, 8) <> "Miniport" Then
        For $rawssid In $obj.Ndis80211BSSIList
            $ssid = ""
            For $i = 0 To UBound($rawssid.Ndis80211SSid)
                $decval = $rawssid.Ndis80211Ssid($i)
                If ($decval > 31 And $decval < 127) Then
                    $ssid = $ssid & Chr($decval)
                EndIf
            Next
            ConsoleWrite($ssid & @CRLF)
        Next
    EndIf
Next

Dosn't seem to do anything for me either (and I know what ConsoleWrite does).

I and absolutly dieing to figure this out! I cant wait to have some way to find my SSID for the project I'm working on.

Edited by Skizmata

AutoIt changed my life.

Share this post


Link to post
Share on other sites

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
Sign in to follow this  

×