Computing.Net > Forums > Programming > auto login script?

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.

auto login script?

Reply to Message Icon

Name: ray
Date: April 26, 2006 at 16:12:34 Pacific
OS: XP
CPU/Ram: 1200/256
Product: athlon
Comment:

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 goto

does anyone know the second part, any clues on where to look or alternatives like an execute or something else to get this done?




Sponsored Link
Ads by Google

Response Number 1
Name: SyberCorp (by sybercorp)
Date: April 26, 2006 at 17:54:04 Pacific
Reply:

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


0

Response Number 2
Name: ray
Date: April 27, 2006 at 03:31:02 Pacific
Reply:

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


0

Response Number 3
Name: Michael J (by mjdamato)
Date: April 27, 2006 at 07:04:40 Pacific
Reply:

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


0

Response Number 4
Name: SyberCorp (by sybercorp)
Date: April 27, 2006 at 15:19:25 Pacific
Reply:

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.


0

Response Number 5
Name: SyberCorp (by sybercorp)
Date: April 27, 2006 at 15:28:36 Pacific
Reply:

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


0

Related Posts

See More



Sponsored Link
Ads by Google
Reply to Message Icon






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: auto login script?

Access Database Login Script www.computing.net/answers/programming/access-database-login-script/11031.html

login script problem www.computing.net/answers/programming/login-script-problem/8742.html

Create Login Script or Page www.computing.net/answers/programming/create-login-script-or-page/3058.html