batch file to close program with schdule

December 9, 2012 at 10:13:28
Specs: Windows 7
Hi
i want to close a program with timer countdown over 1 hour usage.
Example
firefox program is start at 9 am monday i want to close at 10:01 am monday
how can i coding it ?
and i don't want to allow to run in monday.
it will restart over monday

thanks
appologize for my bad english.


See More: batch file to close program with schdule

Report •


#1
December 10, 2012 at 08:15:17
@echo off

; Beging run Firefox
start "" /D"<Firefox folder>" "firefox.exe"
;waiting over 1 hour
time /t 3600
taskkill /f /im "firefox.exe"


Report •

#2
December 11, 2012 at 04:29:11
Hi MarkLee

thanks for reply
but i want to close a program like below example

a frefox.exe is start at 11.12.12 8:00am
i want allow run only 1 hour and let it run after this day ( 12.12.12 (anytime) )

Here my coding

@Echo off
cls
color a

ping -n 3600 127.0.0.1>nul

tasklist
IF EXIST firefox.exe goto A

:A
taskkill /f /im firefox.exe /t

IF %DATE~0,3%==Mon CALL T.bat
IF %DATE~0,3%==Tue CALL T.bat
IF %DATE~0,3%==Wed CALL T.bat
IF %DATE~0,3%==Thu CALL T.bat
IF %DATE~0,3%==Fri CALL T.bat
IF %DATE~0,3%==Sat CALL T.bat
IF %DATE~0,3%==sun CALL T.bat


::Below coding is for T.bat

:loop
taskkill /f /im firefox.exe /t
goto loop

So how can i add coding for day schedule ?

Reguards
Frozy


Report •

Related Solutions


Ask Question