Launching a URL from a batch file

Discussion in 'Javascript' started by VA, Nov 22, 2005.

  1. VA

    VA Guest

    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
     
    VA, Nov 22, 2005
    #1
    1. Advertising

  2. VA

    McKirahan Guest

    "VA" <> wrote in message
    news:...
    > 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?
     
    McKirahan, Nov 22, 2005
    #2
    1. Advertising

  3. VA

    VA Guest

    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
     
    VA, Nov 22, 2005
    #3
  4. VA

    McKirahan Guest

    "VA" <> wrote in message
    news:...
    > 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
     
    McKirahan, Nov 22, 2005
    #4
  5. VA

    VA Guest

    Um, what is that? VB code? How/where would I run that from a batch file?
     
    VA, Nov 22, 2005
    #5
  6. VA

    McKirahan Guest

    "VA" <> wrote in message
    news:...
    > 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
     
    McKirahan, Nov 22, 2005
    #6
  7. VA

    VA Guest

    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, Nov 23, 2005
    #7
  8. VA

    VA Guest

    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!
     
    VA, Nov 23, 2005
    #8
  9. VA

    McKirahan Guest

    "VA" <> wrote in message
    news:...
    > 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();
     
    McKirahan, Nov 23, 2005
    #9
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Jon paugh
    Replies:
    1
    Views:
    881
  2. pomegran
    Replies:
    1
    Views:
    378
    Gordon Beaton
    Oct 1, 2003
  3. porter
    Replies:
    5
    Views:
    2,353
    Mickey Segal
    Nov 16, 2005
  4. Replies:
    0
    Views:
    418
  5. Rob Jones

    ASPNET App and Launching a Batch File...

    Rob Jones, Feb 29, 2004, in forum: ASP .Net Security
    Replies:
    0
    Views:
    118
    Rob Jones
    Feb 29, 2004
Loading...

Share This Page