Saturday 29 August 2015

Gmail Login using VBScript

This script is used to automate gmail login with just a dbl click on the file.
'Configure ur script: Enter your email id and password in the script and save it on your desktop as "Gmail_Login.vbs".

'USERNAME = "yrmailid@gmail.com"
'PASSWORD = "urpassword"

'********************************* Prog begins******************

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

' Replace your email_id and password here... 
USERNAME = "yrmailid@gmail.com"
PASSWORD = "urpassword"

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

On error resume next

'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      ' OR
'IE.document.gaia_loginform.Email.value=USERNAME
IE.document.all.Item("pASSWD").value = PASSWORD     
IE.document.all.item("signIn").click

Set IE = Nothing

if err.number<>0 then
    msgbox "error description: " &err.description & vbnewline  & "error source: " &err.source
end if
on error goto 0

WScript.Quit(0)

'*********************** Ends here***********************

No comments:

Post a Comment