Connect with Expertise | Find Experts, Get Answers, Share Insights

Launching a URL from a batch file

VA
 
Posts: n/a
#1: Nov 23 '05
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


McKirahan
 
Posts: n/a
#2: Nov 23 '05

re: Launching a URL from a batch file


"VA" <usenet@vikas.mailshell.com> wrote in message
news:1132692888.537727.261100@g49g2000cwa.googlegr oups.com...[color=blue]
> 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
>[/color]

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?


VA
 
Posts: n/a
#3: Nov 23 '05

re: Launching a URL from a batch file


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

McKirahan
 
Posts: n/a
#4: Nov 23 '05

re: Launching a URL from a batch file


"VA" <usenet@vikas.mailshell.com> wrote in message
news:1132697955.638640.162620@f14g2000cwb.googlegr oups.com...[color=blue]
> 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
>[/color]

Will this help?

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


VA
 
Posts: n/a
#5: Nov 23 '05

re: Launching a URL from a batch file


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

McKirahan
 
Posts: n/a
#6: Nov 23 '05

re: Launching a URL from a batch file


"VA" <usenet@vikas.mailshell.com> wrote in message
news:1132703533.612454.260230@g49g2000cwa.googlegr oups.com...[color=blue]
> Um, what is that? VB code? How/where would I run that from a batch file?
>[/color]

Save it as IE.VBS.

Create IE.BAT which consists of:

cscript.exe IE.VBS



VA
 
Posts: n/a
#7: Nov 23 '05

re: Launching a URL from a batch file


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

VA
 
Posts: n/a
#8: Nov 23 '05

re: Launching a URL from a batch file


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!

McKirahan
 
Posts: n/a
#9: Nov 23 '05

re: Launching a URL from a batch file


"VA" <usenet@vikas.mailshell.com> wrote in message
news:1132706139.414322.62440@g44g2000cwa.googlegro ups.com...[color=blue]
> 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!
>[/color]

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();


Closed Thread

Tags
var objiea