Does anyone have any idea how to have girder launch xlobby on a thin client on the establishment of a wi-fi connection? Or is there any other way of having it launch automativally?
Thanks hopefully!
On Error Resume Next
strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
regValueDataMetric = "35"
Set colItems = objWMIService.ExecQuery _
("Select * From Win32_NetworkAdapter Where NetConnectionID = 'Wireless Network Connection'")
if colItems.count = 0 then
msgbox "No Wireless Adapter Present!"
else begin
For Each objItem in colItems
msgbox "Name: " & vbTab & vbTab & objItem.Name & vbCrLf _
& "Description: " & vbTab & objItem.Description & vbCrLf _
& "AdapterType: " & vbTab & objItem.AdapterType & vbCrLf _
& "MACAddress: " & vbTab & objItem.MACAddress & vbCrLf _
& "ConnectionStatus: " & vbTab & objItem.NetConnectionStatus & vbCrLf _
& "NetConnectionID: " & vbTab & objItem.NetConnectionID
If objItem.NetConnectionStatus = 2 then
msgBox "ONLINE!"
End if
Next
end if
On Error Resume Next
strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
regValueDataMetric = "35"
ConnectionStatus=7
Do while ConnectionStatus <> 2
Set colItems = objWMIService.ExecQuery _
("Select * From Win32_NetworkAdapter Where NetConnectionID = 'Wireless Network Connection'")
if colItems.count = 0 then
msgbox "No Wireless Adapter Present!"
ConnectionStatus=2
else begin
For Each objItem in colItems
If objItem.NetConnectionStatus = 2 then
msgbox "Name: " & vbTab & vbTab & objItem.Name & vbCrLf _
& "Description: " & vbTab & objItem.Description & vbCrLf _
& "AdapterType: " & vbTab & objItem.AdapterType & vbCrLf _
& "MACAddress: " & vbTab & objItem.MACAddress & vbCrLf _
& "ConnectionStatus: " & vbTab & objItem.NetConnectionStatus & vbCrLf _
& "NetConnectionID: " & vbTab & objItem.NetConnectionID,,"IsConnected.vbs"
Set GirderEvent = CreateObject("Girder.GirderEvent")
GirderEvent.Device = 18
GirderEvent.EventString = "Start Xlobby"
GirderEvent.Send()
ConnectionStatus=2
End if
Next
end if
WScript.Sleep 1000
loop
This works perfectly - I only had to make a minor adjustment in Girder 4.
Set GirderEvent = CreateObject("Girder.GirderEvent")
GirderEvent.Device = 18
GirderEvent.EventString = "Start Xlobby"
GirderEvent.Send()
Set GirderEvent = CreateObject("GirderX.Girder")
call GirderEvent.TriggerEvent("Start Xlobby", 18, "", "", "", 0)