Launching a URL from a batch file

V

VA

I have a report that is accessible by a URL.

How would I go about automating the launching of this URL using, say, a
batch file?

I can put

start iexplore.exe "http://my.url"

in the .bat file

but then the IE window stays open after launching the URL.

Is there a way to script this?

Thanks
 
M

McKirahan

VA said:
I have a report that is accessible by a URL.

How would I go about automating the launching of this URL using, say, a
batch file?

I can put

start iexplore.exe "http://my.url"

in the .bat file

but then the IE window stays open after launching the URL.

Is there a way to script this?

Thanks

Qualify "launch".

Usually one visits a URL with the intention of viewing it;
thus, "the IE window stays open" is the desired effect.

What are you trying to do? What does the Web page do?
 
V

VA

You are right, I should have explained better.

If I were to type/copy-paste that URL in IE manually, it would run a
Cognos report. and show the PDF output (In the background it also
prints the report and saves a copy of the PDF on the web server).

I would like to take the human element out of this by scripting this
interaction. i.e. have a script launch/invoke (dont know what else to
call it) the URL. The mere act of invoking that URL has the (desired)
side-effect of saving the PDF and printing it (thats part of the report
configuration).

Any ideas? Thanks
 
M

McKirahan

VA said:
You are right, I should have explained better.

If I were to type/copy-paste that URL in IE manually, it would run a
Cognos report. and show the PDF output (In the background it also
prints the report and saves a copy of the PDF on the web server).

I would like to take the human element out of this by scripting this
interaction. i.e. have a script launch/invoke (dont know what else to
call it) the URL. The mere act of invoking that URL has the (desired)
side-effect of saving the PDF and printing it (thats part of the report
configuration).

Any ideas? Thanks

Will this help?

Option Explicit
Dim objIEA
Set objIEA = CreateObject("InternetExplorer.Application")
objIEA.Navigate "http://my.url"
While objIEA.Busy
Wend
Set objIEA = Nothing
 
M

McKirahan

VA said:
Um, what is that? VB code? How/where would I run that from a batch file?

Save it as IE.VBS.

Create IE.BAT which consists of:

cscript.exe IE.VBS
 
V

VA

It seems to do everything in the background, I dont actually see the IE
window spring up and close. Can I make it do that?

Is there a way to do a similar thing in Javascript (cscript
something.js), I am more familiar with Javascript than VB, just curious
to know if there is an equivalent solution.

Thanks
 
V

VA

Option Explicit
Dim objIEA
Set objIEA = CreateObject("InternetExplorer.Application")
objIEA.Navigate "http://www.yahoo.com"
objIEA.visible = true
While objIEA.Busy
Wend
objIEA.Quit
Set objIEA = Nothing

Seems to do what I want.

Thanks for the tip!
 
M

McKirahan

VA said:
Option Explicit
Dim objIEA
Set objIEA = CreateObject("InternetExplorer.Application")
objIEA.Navigate "http://www.yahoo.com"
objIEA.visible = true
While objIEA.Busy
Wend
objIEA.Quit
Set objIEA = Nothing

Seems to do what I want.

Thanks for the tip!

You like JavaScript then how about:

var objIEA = new ActiveXObject("InternetExplorer.Application");
objIEA.navigate("http://www.google.com/");
objIEA.visible = true;
while(objIEA.readyState != 4) {}
objIEA.quit();
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,576
Members
45,054
Latest member
LucyCarper

Latest Threads

Top