Computing.Net > Forums > Programming > Batch file query

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.

Batch file query

Reply to Message Icon

Name: biddelcastro
Date: June 26, 2008 at 02:46:55 Pacific
OS: XP
CPU/Ram: na
Product: na
Comment:

Trying to create a batch file to open and login to a webpage.

The opening of the web page is easy, IE is default browser so cmd line is:

Start http://www.*********.com

The bit I cant find info on is logging in.

Is it possible to login using a batch file?

Any advice appreciated,

Thanks

??



Sponsored Link
Ads by Google

Response Number 1
Name: klint
Date: June 26, 2008 at 02:56:27 Pacific
Reply:

You need to use VBScript and the SendKeys function. Do a google search for these two terms and you'll find lots of information on how to use them.


0

Response Number 2
Name: Razor2.3
Date: June 26, 2008 at 03:42:11 Pacific
Reply:

VBScript's SendKeys should be used as a last resort. VBS can use IE's ActiveX controls to do the work, so that should be used instead.

But unless you can type in an address that'll log you in, you cannot do what you want from Command Script.


0

Response Number 3
Name: biddelcastro
Date: June 26, 2008 at 04:24:17 Pacific
Reply:

Had a look at VBS, seems like a good idea to use that.

Once again thanks for your help.

??


0

Response Number 4
Name: ghostdog
Date: June 26, 2008 at 05:38:49 Pacific
Reply:

get a better language that can support HTTP queries. See here: http://www.voidspace.org.uk/python/...
and here : http://www.voidspace.org.uk/python/...
for Python references. Similarly for Perl, you can use modules like LWP etc. Forget about using batch for what you are doing.


0

Response Number 5
Name: klint
Date: June 26, 2008 at 05:48:06 Pacific
Reply:

Ghostdog,
Python and Perl libraries can fetch URLs with proper authentication, but what if you actually want to view the page, not just parse it?


0

Related Posts

See More



Response Number 6
Name: ghostdog
Date: June 26, 2008 at 07:52:18 Pacific
Reply:

klint, it depends on what you mean by "view" the page. most simply, save the page as html, and call the browser to view it.
eg snippet for Python


import urllib2,os
url = "http://www.google.com"
page=urllib2.urlopen(url)
f=open("google.html","w")
f.write(page.read())
f.close()
os.system("firefox google.html")

or another way is to just simple use the webbrowser module

import webbrowser
url="http://www.google.com"
webbrowser.open(url)



0

Response Number 7
Name: FishMonger
Date: June 26, 2008 at 07:54:53 Pacific
Reply:

If the person is sitting at the computer and wants to view the page, it doesn't make any sense to me to use a script to load the page and login. But if that's what's wanted, then there is a Perl module that will do it.

Win32::IEAutomation
http://search.cpan.org/~prashant/Wi...


0

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: Batch file query

batch file name date and time www.computing.net/answers/programming/batch-file-name-date-and-time/15060.html

Batch File www.computing.net/answers/programming/batch-file/12843.html

Batch file to copy the lines www.computing.net/answers/programming/batch-file-to-copy-the-lines/11114.html