Computing.Net > Forums > Programming > VBscript to enter username and password

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

VBscript to enter username and password

Reply to Message Icon

Name: madhavicnn
Date: June 27, 2009 at 11:36:31 Pacific
OS: Windows XP
Subcategory: Batch
Comment:

Hi all!

If someone would be so kind and help me find a command to enter a username and password in a web page?

For example if i have a batch:
@echo off
start http://www.google.com/mail

And if you notice it will have a username and password prompt.

Is there a command that will enter your username and password in those boxes?

Any help will be appreciated!

Thanks ,
Madhavi



Sponsored Link
Ads by Google

Response Number 1
Name: RTAdams89
Date: June 27, 2009 at 12:52:36 Pacific
Reply:

There are macro programs out there that might be able to do this, but using strictly vbscript or a batch file running on the local computer is not going to work.

-Ryan Adams
Free Computer Tips and more:http://RyanTAdams.com

Paid Tech Support: Black Diamond


0

Response Number 2
Name: Razor2.3
Date: June 27, 2009 at 13:36:49 Pacific
Reply:

RTAdams89: using strictly vbscript or a batch file running on the local computer is not going to work.
This is incorrect. Internet Explorer exposes the DOM though its ActiveX control, which can be used by VBScript to interact with the website.


0

Response Number 3
Name: madhavicnn
Date: June 28, 2009 at 01:35:46 Pacific
Reply:

Can you provide an alternate for same ?


0

Response Number 4
Name: Razor2.3
Date: June 28, 2009 at 08:20:28 Pacific
Reply:

As I said, Internet Explorer exposes the page's DOM. This means you can make an auto log on script, but it must be customized for each page. For Google Mail, your script would go something like this:

WScript.Quit Main

Function Main
  Set IE = WScript.CreateObject("InternetExplorer.Application", "IE_")
  IE.Visible = True
  IE.Navigate "http://www.google.com/mail"
  Wait IE
  With IE.Document
    .getElementByID("Email").value = "you@gmail.com"
    .getElementByID("Passwd").value = "Your Password"
    .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


0

Response Number 5
Name: RTAdams89
Date: June 28, 2009 at 17:35:28 Pacific
Reply:

Wow. I've never seen that work before. Good job Razor.

-Ryan Adams
Free Computer Tips and more:http://RyanTAdams.com

Paid Tech Support: Black Diamond


0

Related Posts

See More



Sponsored Link
Ads by Google
Reply to Message Icon

How to Parse Comments fro... java expert using blueJ



Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Programming Forum Home


Sponsored links

Ads by Google


Results for: VBscript to enter username and password

Cmd To enter username and password www.computing.net/answers/programming/cmd-to-enter-username-and-password/16996.html

Username and Password in cmd www.computing.net/answers/programming/username-and-password-in-cmd/14695.html

VB5 - Check Username and Password www.computing.net/answers/programming/vb5-check-username-and-password/12314.html