Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
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/mailAnd 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

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.comPaid Tech Support: Black Diamond

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.

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

Wow. I've never seen that work before. Good job Razor.
-Ryan Adams
Free Computer Tips and more:http://RyanTAdams.comPaid Tech Support: Black Diamond

![]() |
How to Parse Comments fro...
|
java expert using blueJ
|

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