How to close a program at a certain time and run the program at a certain time on windows?

On a windows xp pc, I'd like to close a program at 6 pm at night and then run it at 6 am in the morning?
I looked at scheduled tasks. It seems you can only run a program and not close it from it?

Should I go try to write something on autohotkey or is there an easier way?

Who is Participating?
B HCommented:
you can also add it with at commands:

at 18:00 /every:monday,tuesday,wednesday,thursday,friday,saturday,sunday "taskkill /IM whatever.exe /F"
at 06:00 /every:monday,tuesday,wednesday,thursday,friday,saturday,sunday "c:\wherever\whatever.exe"
B HCommented:
you can use a scheduled task to run this command:
taskkill /IM whatever.exe /F

where whatever.exe is the name of the program's executable file
awesomejohn19Author Commented:
Ok, So I am going to the scheduled task wizard. Where do I write
 taskkill /IM whatever.exe /F

B HCommented:
yes that will work
you can also create a batch file called for example, start-this-thing.bat
in the bat file you could put that line
then schedule the bat file
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.