Auto inet(simpler version)


SUBMITTED BY: Guest

DATE: May 3, 2013, 4:25 p.m.

FORMAT: Text only

SIZE: 1.7 kB

HITS: 1284

  1. Function Bslogin(username,password)
  2. Set objL = CreateObject("WScript.Shell")
  3. objL.run("chrome --app=http://10.166.250.5/termsAuth/index.htm?www.google.com/")
  4. WScript.sleep 2000
  5. objL.SendKeys "{TAB}"
  6. objL.SendKeys " "
  7. objL.SendKeys "{TAB}"
  8. objL.SendKeys " "
  9. WScript.sleep 1000
  10. objL.SendKeys "^a"
  11. objL.SendKeys username
  12. objL.sendKeys "{TAB}"
  13. objL.SendKeys "^a"
  14. objL.SendKeys password
  15. objL.SendKeys "{ENTER}"
  16. WScript.sleep 2000
  17. objL.SendKeys "%{F4}"
  18. objL.sendkeys "{ESC}"
  19. End Function
  20. Function Ping(strHost)
  21. Dim oPing, oRetStatus, bReturn
  22. Set oPing = GetObject("winmgmts:{impersonationLevel=impersonate}").ExecQuery("select * from Win32_PingStatus where address='" & strHost & "'")
  23. For Each oRetStatus In oPing
  24. If IsNull(oRetStatus.StatusCode) Or oRetStatus.StatusCode <> 0 Then
  25. bReturn = False
  26. Else
  27. bReturn = True
  28. End If
  29. Set oRetStatus = Nothing
  30. Next
  31. Set oPing = Nothing
  32. Ping = bReturn
  33. End Function
  34. username="2012LiHX"
  35. password="xuan1624"
  36. toping="www.google.com"
  37. Set obj=CreateObject("WScript.shell")
  38. hotspotname="Eq"
  39. Dim errlvl
  40. Do
  41. If Not Ping(toping) Then
  42. obj.Run "netsh wlan connect name="&hotspotname&"&setx ERL=%ERRORLEVEL%",,True
  43. errlvl = obj.ExpandEnvironmentStrings( "%ERL%" )
  44. obj.Run "REG delete HKCU\Environment /F /V ERL",,True
  45. If (errorlvl=1 And Hour>=7) Then
  46. If Not Ping("10.166.250.5") Then
  47. obj.Run "netsh wlan connect name=wireless@bs",,True
  48. End If
  49. Bslogin username,password
  50. End If
  51. End If
  52. WScript.sleep 900000
  53. Loop

comments powered by Disqus