- Jan 19, 2018
- 12
- 3
Anyone using a IP script to geofence? I can't get mine to work.
Code:
Set wshShell = CreateObject("WScript.Shell")
Set IE = CreateObject("InternetExplorer.Application")
Set WshShell = WScript.CreateObject("WScript.Shell")
daniel = "192.168.1.7"
elana = "192.168.1.8"
someoneishome = "http://192.168.1.5:81/admin?profile=1"
nooneishome = "http://192.168.1.5:81/admin?profile=2"
'Run the ping program 3 times, with a 2000ms delay on each, 0 = don't display cmd prompt
'All three pings must be successful for CBool = true
WScript.Sleep 90000
isdanielhome = Not CBool(wshShell.run("ping -n 3 -w 900 " & daniel,0,True))
iselanahome = Not CBool(wshShell.run("ping -n 3 -w 900 " & elana,0,True))
If isdanielhome = True or iselanahome = True Then
IE.Navigate "http://192.168.1.5:81/admin?profile=1"
Else
IE.Navigate "http://192.168.1.5:81/admin?profile=2"
End If
'Release memory
Set wshShell = Nothing