Wednesday, February 16, 2005

VBScript to Automate login into gmail

Dim IE
Dim uSERNAME
Dim PASSWORD
Dim crtScreen
Set IE = CreateObject("InternetExplorer.Application")
USERNAME = "saudaziz"
PASSWORD = ""

With IE
.navigate "http://www.gmail.com"
.visible=1
End With

'wait a while until IE as finished to load
Do while IE.busy
loop
set WshShell = WScript.CreateObject("WScript.Shell")
Do While UCase(IE.Document.readyState) <> "COMPLETE"
WScript.Sleep 100
DoEvents
Loop
set WshShell=nothing
IE.document.all.Item("Email").value = USERNAME
IE.document.all.Item("pASSWD").value =pASSWORD
'IE.document.gaia_loginform.Email.value=USERNAME
IE.document.all.item("null").click
Set IE = Nothing

WScript.Quit(0)
Post a Comment