How to Auto Login to website (Gmail, Yahoo) using vbs (VB Script)

There are a number of ways to login automatically to a website. Here I am writing this post to login into Gmail and Yahoo account.

How will you auto login into your Gmail & Yahoo account? It’s not as hard as it sounds but you will have to change some details like username & password in below mentioned code.

Auto Login

Just follow below steps to auto login to Gmail & Yahoo.

Step-1: Open a notepad and paste below mentioned code in it and save it gmail.vbs and yahoo.vbs.


You are free to choose any other name which you like most but it is familiar and you will not get confused.

Step-2: Copy below mentioned script in notepad to auto login into G-mail account.


On Error Resume Next

Const PAGE_LOADED = 4

Set objIE = CreateObject("InternetExplorer.Application")

Call objIE.Navigate("http://www.gmail.com")

objIE.Visible = True

Do Until objIE.ReadyState = PAGE_LOADED : Call WScript.Sleep(100) : Loop

objIE.Document.all.Email.Value = "your_username"

objIE.Document.all.Passwd.Value = "Your_Password"

If Err.Number <> 0 Then

msgbox "Error: " & err.Description

End If

Call objIE.Document.all.gaia_loginform.submit

Set objIE = Nothing

Step-3: Copy below mentioned script in notepad to auto login into Yahoo account.

On Error Resume Next

Const PAGE_LOADED = 4

Set objIE = CreateObject("InternetExplorer.Application")

Call objIE.Navigate("http://www.yahoomail.com")

objIE.Visible = True

Do Until objIE.ReadyState = PAGE_LOADED : Call WScript.Sleep(100) : Loop

objIE.Document.all.username.Value = " your_username "

objIE.Document.all.Passwd.Value = " Your_Password "

If Err.Number <> 0 Then

msgbox "Error: " & err.Description

End If

Call objIE.Document.all.login_form.submit

Set objIE = Nothing

You have to just change your username and password.

After saving it as .vbs, connect to the internet and double click on gmail.vbs or yahoo.vbs file.

It will automatically login into your Gmail and Yahoo account.

Don’t forget to write comment in below comment box, if you like it.

SiteGround Black Friday Sale Below Banner

Get Free Blogging Tips & Technology updates in your Email !!!

Subscribe via RSS feed

The following two tabs change content below.
Anil Kumar
IT Blogger Tips focus on Blogging Tips, SEO Tips, Social Media, SQL Tips, PL/SQL Tips, Oracle DBA, Linux/Unix, Latest Technology, How Tos and Technical Solutions. You can find us on Facebook | Twitter |
Find on Google+

  • durgesh

    Great thing you have shared i like it and used it thanks.

  • Way 2 resources

    Hello,

    I am getting a problem while executing this as vb script and the error line is :
    Set objIE = CreateObject(“InternetExplorer.Application”)
    Please let me know the solution.

    • admin

      hi,

      When you copy source codes from any website which includes double quotation in the code (” “). There will always be a problem.
      Just copy the code in notepad and you can resolve this issue by typing or replacing the double quotes again.

  • amarnath

    Nice information,bt i would like to suggest you can also use gmail offline in my blog and any guidance for my blog

    • Yes you are right, we can use offline Gmail but if we want to login fast into our online Gmail account then this script is really useful.

Siteground SALE
70% OFF SiteGround WordPress Hosting – $2.95/month (Exclusive Offer !!!)