How to end a Scheduled Task

J

James Ivey

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
 
A

Andrew McLaren

James said:
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.

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
 
R

Richard G. Harper

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.
 

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

Top