(Sorry,I do a little change in my answer)
I want to know can I write a program that runs at a specific time?Is there any way to run a program automatically? And another question:Can I write a program that runs whenever another program is executed?
Note that it does not matter what the OS is,and I want a way to be in program code,that is I write a line of code that do the operation,because I cannot prompt different users to change their OS options to do the operation.