Page 1 of 1

NetStumbler From VB Script

PostPosted: Tue Aug 22, 2006 12:06 pm
by jlskill@aol.com
Ok...If you saw my previous posting you know I could not get NetStumbler to talk to VB6.0, so thought Id better FIRST be sure I could get it to talk to VB Script. So I tried:


---------------------------------------------------
'---- My Test Script with NetStumbler ---
Dim cnt:cnt=0
Dim ExitNow:ExitNow=False
WScript.Echo "Start"
'----
'Dim STUM: set STUM= Wscript.GetObject_("NetStumbler.exe","EV")
DIM TTS: Set TTS=createobject("sapi.Spvoice")
'----
TTS.Priority=2
TTS.Speak "START!!"
TTS.Speak "GO GO"
Do

cnt=cnt+1
if cnt>5000000 then
TTS.Speak "Still Running"
cnt=0
' WScript.Echo "TimeOut. Quit"
' ExitNow=True
end if

Loop Until ExitNow
on error resume next

WScript.Echo "Error Exit"

'--------- Events ---------------

Sub OnScanResult (SSID,BSSID,capFlags,Signal,LastSceen)
WScript.Echo "A Scan Completed"
TTS.Speak "Got Event!"
end sub
------------------------------------

This never gets an 'OnScanResult' Event So Ive obviously left something out.
I could not figure how to bind the NetStumbler.exe runninmg on my computer to this script. I dont know the progID I guess.
----
From above you can see I tried;

Dim STUM: set STUM= Wscript.GetObject_("NetStumbler.exe","EV")

But that did not compile, I would guess cause "NetStumbler.exe" was the wrong progID?
----
I looked thru the ns04Master.vbs script provided, but could not see in there where this binding was carrierd out.

Can someone streighten me out on this?

Thanks,

John

PostPosted: Tue Aug 22, 2006 12:07 pm
by wrzwaldo
Looks like a good post for the "Scripts" forum.

PostPosted: Tue Aug 22, 2006 12:48 pm
by G8tK33per
Moved.

PostPosted: Sat Aug 26, 2006 5:32 am
by tpeer
Instead of running netstumbler from vb, it might be easier to make netstumbler write a log file using a script, and have your vb program monitor the log file...

Ted

PostPosted: Sat Aug 26, 2006 5:49 am
by Dutch
[quote="jlskill@aol.com"]Ok...If you saw my previous posting you know I could not get NetStumbler to talk to VB6.0, so thought Id better FIRST be sure I could get it to talk to VB Script. So I tried:


---------------------------------------------------
'---- My Test Script with NetStumbler ---
Dim cnt:cnt=0
Dim ExitNow:ExitNow=False
WScript.Echo "Start"
'----
'Dim STUM: set STUM= Wscript.GetObject_("NetStumbler.exe","EV")
DIM TTS: Set TTS=createobject("sapi.Spvoice")
'----
TTS.Priority=2
TTS.Speak "START!!"
TTS.Speak "GO GO"
Do

cnt=cnt+1
if cnt>5000000 then
TTS.Speak "Still Running"
cnt=0
' WScript.Echo "TimeOut. Quit"
' ExitNow=True
end if

Loop Until ExitNow
on error resume next

WScript.Echo "Error Exit"

'--------- Events ---------------

Sub OnScanResult (SSID,BSSID,capFlags,Signal,LastSceen)
WScript.Echo "A Scan Completed"
TTS.Speak "Got Event!"
end sub
------------------------------------

This never gets an 'OnScanResult' Event So Ive obviously left something out.
I could not figure how to bind the NetStumbler.exe runninmg on my computer to this script. I dont know the progID I guess.
----
From above you can see I tried]

You are doing it the wrong way around. It is not VBscript talking to NS, it is NS talking to VBScript. You get NS to run the script, just like the way the masterscript is run, not the script to run NS.
Start NS, then select the script you want to run from within NS. It can be VBScript, it can be Perl, or whatever other scriptinglanguage engine you have installed on your system.
Read the scripting API on the authors website, for available calls, and how to use it.

Dutch