Thursday 20 June 2013

Automatically connect Gmail account.

Automatically connect GMAIL:  [VB SCRIPT]

WScript.Quit Main

Function Main
  Set IE = WScript.CreateObject("InternetExplorer.Application", "IE_")
  IE.Visible = True
  IE.Navigate "http://www.gmail.com"
  Wait IE
  With IE.Document
    .getElementByID("Email").value = "userid@gmail.com"
    .getElementByID("Passwd").value = "password@1234"
    .getElementByID("gaia_loginform").submit
  End With
End Function

Sub Wait(IE)
  Do
    WScript.Sleep 500
  Loop While IE.ReadyState < 4 And IE.Busy
  Do
    WScript.Sleep 500
  Loop While IE.ReadyState < 4 And IE.Busy
End Sub

Sub IE_OnQuit
  On Error Resume Next
  WScript.StdErr.WriteLine "IE closed before script finished."
  WScript.Quit
End Sub