I am working on a program that will have to delete a folder (and then recreate it) at a specific hour of the day, and this hour will be provided by the user.
The hour will most likely be at night, because when no one accesses the folder (it is outside of working hours). Is there any way to trigger this event at this specific hour?
I know about timers, but is there an easier way to do this without a timer that ticks and checks what time it is?
EDIT . Perhaps I was not specific enough. I want to call a method to do something, without having to first compile it into a separate executable. This method is part of a larger class that is implemented as a Windows service. Thus, this service is constantly running, but at a certain time of the day it should call this function to delete the folder.
Thanks.
source share