NetStumbler From VB Script

Take a script, leave a script - Like the penny tray only different

NetStumbler From VB Script

Postby jlskill@aol.com » Tue Aug 22, 2006 12:06 pm

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
jlskill@aol.com
 
Posts: 4
Joined: Fri Aug 18, 2006 12:47 pm
Location: Dekalb, IL

Postby wrzwaldo » Tue Aug 22, 2006 12:07 pm

Looks like a good post for the "Scripts" forum.
wrzwaldo
 
Posts: 8995
Joined: Sun Dec 14, 2003 12:43 pm

Postby G8tK33per » Tue Aug 22, 2006 12:48 pm

Moved.
"Make yourselves sheep and the wolves will eat you." ~ Benjamin Franklin

Sons of Confederate Veterans
User avatar
G8tK33per
 
Posts: 6078
Joined: Fri May 09, 2003 4:00 am
Location: Goomba's Booty Boardwalk

Postby tpeer » Sat Aug 26, 2006 5:32 am

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
tpeer
Mini Stumbler
 
Posts: 21
Joined: Fri Apr 23, 2004 5:13 pm

Postby Dutch » Sat Aug 26, 2006 5:49 am

[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
All your answers are belong to Google. SEARCH DAMMIT!
Warning. Warning.
Low C8H10N4O2 level detected. Operator halted....
User avatar
Dutch
 
Posts: 6698
Joined: Fri Mar 05, 2004 12:00 pm
Location: City of Mermaids, Denmark


Return to Scripts

Who is online

Users browsing this forum: No registered users and 1 guest