1. Welcome Guest! In order to create a new topic or reply to an existing one, you must register first. It is easy and free. Click here to sign up now!.
    Dismiss Notice

How to end a Scheduled Task

Discussion in 'Windows Vista' started by James Ivey, Sep 3, 2009.

  1. James Ivey

    James Ivey Guest

    I've got a Scheduled Task that simply opens up a browser window. The
    browser Home Page points to a php script sitting on my website that executes
    when the browser opens. So far so good.

    How do I then automatically close the browser window? I would like the
    window to close say, a minute after it opens so that I don't have to close
    it manually.

    Thanks.

    James
     
  2. James Ivey wrote:<!--coloro:blue--><span style="color:blue <!--/coloro-->
    > I've got a Scheduled Task that simply opens up a browser window. The
    > browser Home Page points to a php script sitting on my website that
    > executes when the browser opens. So far so good.
    > How do I then automatically close the browser window? I would like the
    > window to close say, a minute after it opens so that I don't have to
    > close it manually.<!--colorc--><!--/colorc-->

    Once the scheduled task has launched the browser, the browser process
    continues to run independently of the scheduled task. So even if you
    kill or exit the scheduled task process, the browser process
    (IExplore.exe, I guess?) keeps running under its own steam. This is in
    keeping with the general Windows process model, which doesn't use the
    same parent-child, fork-exec model found in Unix and Linux. Every
    Windows process is basically stand-alone (there are many subtleties and
    exceptions, but that's close enough for now).

    So to close the browser window, you'd need to run a script on that PHP
    web page to close it automatically; or else, you'd need to kill the
    browser process.

    You could add a command to your scheduled task job, to kill the browser:

    TASKKILL /F /IM IExplore.exe

    Although, this would kill *all* current browser windows running; not
    just the one started by the scheduled task. Dunno if that's what you
    want or not.

    Depending on what browser you're using, you could launch a second window
    which runs some local JavaScript; what it does is limited only by the
    browser's APIs and your ingenuity. There may be script you could run to
    close open windows.

    Other folks may have extra ideas.

    Hope it helps,

    Andrew
    --
    amclar at optusnet dot com dot au
     
  3. Unfortunately, you cannot. This would have to be a feature built into
    Internet Explorer for that to happen, Task Scheduler only calls the task and
    then it (Task Scheduler) goes away. What happens from there is up to the
    task that's called.

    "James Ivey" <nope@nowhere.com> wrote in message
    news:uTGAWvOLKHA.1380@TK2MSFTNGP02.phx.gbl...<!--coloro:blue--><span style="color:blue <!--/coloro-->
    > I've got a Scheduled Task that simply opens up a browser window. The
    > browser Home Page points to a php script sitting on my website that
    > executes when the browser opens. So far so good.
    >
    > How do I then automatically close the browser window? I would like the
    > window to close say, a minute after it opens so that I don't have to close
    > it manually.
    >
    > Thanks.
    >
    > James
    > <!--colorc--><!--/colorc-->
     

Share This Page