Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Javascript > Launching a URL from a batch file

Reply
Thread Tools

Launching a URL from a batch file

 
 
VA
Guest
Posts: n/a
 
      11-22-2005
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

 
Reply With Quote
 
 
 
 
McKirahan
Guest
Posts: n/a
 
      11-22-2005
"VA" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed) oups.com...
> 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?


 
Reply With Quote
 
 
 
 
VA
Guest
Posts: n/a
 
      11-22-2005
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

 
Reply With Quote
 
McKirahan
Guest
Posts: n/a
 
      11-22-2005
"VA" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed) oups.com...
> 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


 
Reply With Quote
 
VA
Guest
Posts: n/a
 
      11-22-2005
Um, what is that? VB code? How/where would I run that from a batch file?

 
Reply With Quote
 
McKirahan
Guest
Posts: n/a
 
      11-22-2005
"VA" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed) oups.com...
> 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



 
Reply With Quote
 
VA
Guest
Posts: n/a
 
      11-23-2005
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

 
Reply With Quote
 
VA
Guest
Posts: n/a
 
      11-23-2005
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!

 
Reply With Quote
 
McKirahan
Guest
Posts: n/a
 
      11-23-2005
"VA" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed) ups.com...
> 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();


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Weird error messages with XP when launching URL files -- Success! Zaghadka Firefox 0 03-27-2007 01:44 AM
Issues with launching Batch files on Win2003 (not Win2000) ee_stevek@hotmail.fr ASP .Net 0 07-13-2006 01:25 PM
URL launching behaviour using showDocument in IE6(sp2 XP) porter Java 5 11-16-2005 05:56 PM
ASPNET App and Launching a Batch File... Rob Jones ASP .Net Security 0 02-29-2004 02:46 AM
Converting a URL to a flat file in batch ... pomegran Java 1 10-01-2003 12:54 PM



Advertisments