Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
My question is the following, i'm trying to program a little script that automaticly launches IE, goes to an url and fills in an username and password and also does click the login button.
I know you can do the first part with a batch file.
something like...
@echo off
start c:\progra~1\intern~1\iexplore.exe http://whatever.com/login
/size 1 1 400 400
end gotodoes anyone know the second part, any clues on where to look or alternatives like an execute or something else to get this done?

Why not just format the string the same way you would for an FTP site link? It would look something like this:
http://username:password@www.website.com/login

I just tried it, but it doesn't work. only goes to the login site and nothing happens. any other ideas?

You can't do exactly what you want with a batch file. I don't think a batch file can control elements in another program like that. VBScript can, but I think that would be too much work and might be error prone.
Here is anothre solution. Go to the login page and copy the form into a local HTML document. Then add the values for your username and password to the appropriate fields. Using that you now have a page that you simple need to just submit to log into the site (I have done this for a site which does not allow you to create your own passwords and gave me a password that I don not care to try and remember).
Anyway, you now have a page that you can call with your script. The problem now is submitting the form.
You could add the following at the bottom of the HTML page which would submit the form automatically:
<script>document.formname.submit();</script>
But the problem is that IE by default will not run javaScript in local HTML files. A security alert will come up which will allow you to indicate if you want to run it or not. The only way to get past that, that I can think of, is to lower the security settings in IE. There may be a place just to allow javascript in local HTML files without lowering other security settings as well.
Michael J

You know what... I just remembered that Microsoft changed the security in IE to prevent people from using links like the one I gave you to access HTTP sites. It still works for FTP sites though. Other browsers, like FireFox and Opera still allow the method, but not IE. Sorry. I had forgotten until I read what the other guy posted. Then it clicked. There's an article on Microsoft's Knowledgebase about this, but I don't remember if it tells you how to turn it back on.

Here's a registry modification that allows IE to use HTTP links that have a username and password in them again. (To re-enable the feature Microsoft turned off)
This should do what you want.
Just right-click on the link and select Save Target As...http://sybercorp.sourceforge.net/IEUserPassEnable.reg

![]() |
![]() |
![]() |

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