I am trying to write a script that will detect if an iPhone is connected to the routers WiFi. Initially I worked on the premise that all I needed to do was Ping the iPhone's fixed IP address of 192.168.1.12. Unfortunately after spending a few hours building and testing a script I discovered that the iPhone goes into sleep mode timeout if not used thus switching WiFi and Bluetooth to standby to conserve battery power.. so pinging the iPhone's IP address fails.
After that I discovered that the Vigor2860Ln router does in fact maintain the IP address of the iPhone even when sleeping so I came up with the following VBScript which works fine - I can login to the router and produce the required output in a CMD window but I cannot find how to pull the returned output to see if the IP address 192.168.1.12 exists
Any help would be appreciated.
'(Start of Script)--------------------------
Set MyObject = CreateObject("WScript.Shell")
MyObject.run "cmd"
WScript.Sleep 500
MyObject.SendKeys"telnet 192.168.1.1"
MyObject.SendKeys("{Enter}")
WScript.Sleep 500
MyObject.SendKeys"admin" '(UserName)
MyObject.SendKeys("{Enter}")
WScript.Sleep 500
MyObject.SendKeys"******" '(User Password)
MyObject.SendKeys("{Enter}")
WScript.Sleep 500
MyObject.SendKeys "wl stalist show " '(Query Router Data)
MyObject.SendKeys "quit{ENTER}"
'(End of Script)--------------------------
(The above script Produces a CMD window containing the following.)
Index Status IP Address MAC Address Associated with
1 A 192.168.1.16 MAC Address 1 SSID #1
2 A 192.168.1.15 MAC Address 2 SSID #1
3 A 192.168.1.13 MAC Address 3 SSID #1
4 A 192.168.1.12 MAC Address 4 SSID #1 (Does this IP or MAC address exist? - If not then iPhone is NOT connected)
After that I discovered that the Vigor2860Ln router does in fact maintain the IP address of the iPhone even when sleeping so I came up with the following VBScript which works fine - I can login to the router and produce the required output in a CMD window but I cannot find how to pull the returned output to see if the IP address 192.168.1.12 exists
Any help would be appreciated.
'(Start of Script)--------------------------
Set MyObject = CreateObject("WScript.Shell")
MyObject.run "cmd"
WScript.Sleep 500
MyObject.SendKeys"telnet 192.168.1.1"
MyObject.SendKeys("{Enter}")
WScript.Sleep 500
MyObject.SendKeys"admin" '(UserName)
MyObject.SendKeys("{Enter}")
WScript.Sleep 500
MyObject.SendKeys"******" '(User Password)
MyObject.SendKeys("{Enter}")
WScript.Sleep 500
MyObject.SendKeys "wl stalist show " '(Query Router Data)
MyObject.SendKeys "quit{ENTER}"
'(End of Script)--------------------------
(The above script Produces a CMD window containing the following.)
Index Status IP Address MAC Address Associated with
1 A 192.168.1.16 MAC Address 1 SSID #1
2 A 192.168.1.15 MAC Address 2 SSID #1
3 A 192.168.1.13 MAC Address 3 SSID #1
4 A 192.168.1.12 MAC Address 4 SSID #1 (Does this IP or MAC address exist? - If not then iPhone is NOT connected)