-1

I want to build a simple .bat file that after a predetermined set of time (like an hour or so) it will kill a program once's it's started. So say I run the batch file and after 1 hour or so it will kill another program (say firefox)

2 Answers2

0

To make the batch execution pause, you can use a kludge as described in this answer. The 3600 corresponds to 3600 seconds, or one hour.

ping 127.0.0.1 -n 3600 > nul

To kill firefox, you can add a command such as

taskkill /im firefox.exe
Community
  • 1
  • 1
0

dr_andonuts has a standard way or practice I observe many do

An alternative is

batchfile content:

timeout 3600

taskkill /f /im firefox.exe

Community
  • 1
  • 1