Click here to Skip to main content
15,885,116 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I need to create a program that kills a process during a certain time frame and on certain days.

Example I want to stop firefox on mondays, tuesdays and fridays. During the times of 9am to 3pm. But allow it to run after and before that.

Any suggestions?

What I have tried:

At this point I have looked at other examples but have not come to a proper way of doing it.
Posted
Updated 17-Oct-20 20:03pm

1 solution

Why re-invent the wheel?
There are two ways to do this: How to Set App & Game Limits on Windows 10[^] which uses parental controls, and Group Policies is another: How to Block (or Allow) Certain Applications for Users in Windows[^]

Other wise, you are looking at monitoring the processes list, and killing unwanted processes in a background thread - which while pretty simple has to be approached with caution as it may not be obvious what process(s) you need to kill. There is also the fun of keeping your app running at all times, which generally is very simple to defeat ...
 
Share this answer
 
Comments
RobertBurlile16 7-Dec-20 13:35pm    
I had figured it out by listing the processes that I want not to run. Then using a time function to determine when the processes will not run. Extensive with timers. I am using this to help keep my kids focused during their class times on zoom and try not to deviate from what they need to do. A couple of months later I got it working fine. I may want to further it down the road but what I have will be well enough. Thank you.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900