Link to home
Start Free TrialLog in
Avatar of heydorft
heydorft

asked on

script/batch that auto closes internet explorer and firefox windows after 5 minutes

I need a script/batch that will close out all internet explorer and firefox.I am wanting to know if it can be run through xp scheduled task.
ASKER CERTIFIED SOLUTION
Avatar of chirkware
chirkware
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of ShadKianAsh
ShadKianAsh

You can use the task schedule to launch a batch...
and you can used pskill in that batch to kill all your IE and Firefox windows.
you can download pskill from here:http://download.sysinternals.com/Files/PsTools.zip
all you need to do is agree the terms of use the first time that you use pskill,

maybe your batch looks like this:
@echo off
pskill firefox.exe
pskill iexplorer.exe
Did you want to see if firefox is running for more than 5 minutes and then close it..
Or every 5 minutes  close any active firefox processes?

I will prepaire you the script...
Avatar of heydorft

ASKER

every 5 minutes close any firefox or ie processes
they'll have already provided the simplest solution
how do I make it run every 5 minutes in scheduled task. do I add every 5 minutes repeat task and then instead of for an 1hour just add 24
schtasks /create /sc minute /mo 5 /tn "Kill-Firefox-IExplorer" /tr path_to_your_script
To run every five minutes, schedule it to run at whatever time every day, then under advanced, tell it to repeat every five minutes for a duration of 24 hours.  It will continue to run every five minutes unless the PC gets rebooted, in which case it will start running every five minutes the next day at the time you specified.  

I guess you could schedule multiple scheduled tasks to run the batch file, and set them to start say 4 hours apart.  Set each to repeat every 5 minutes for 4 hours.  Something like that will make sure it starts doing this again sooner after a reboot.  Unfortunately, "daily" is as often as you can specify.  You can select "At startup", but the repeat option is not there then.  :(