C++ Have program run itself at a given time.

I'm working on a sort of service type program in which the user would at some point set the time at which he wants the executable of the program to start back up.

How would I go about doing this? Would it involve saving a beacon in some Windows file?
Cyber-DragonAsked:
Who is Participating?
 
evilrixSenior Software Engineer (Avast)Commented:
>> Have you tried looking at the Windows tack scheduler?
Heres the relevant SDK documentation for the Windows task scheduler.
http://msdn.microsoft.com/en-us/library/aa383614.aspx
0
 
evilrixSenior Software Engineer (Avast)Commented:
>> How would I go about doing this? Would it involve saving a beacon in some Windows file?
Have you tried looking at the Windows tack scheduler?
http://support.microsoft.com/kb/308569

The alternative is to have the process always running as a daemon or service, sleeping until the given time it is next due to run.
0
 
jbachmanNETCommented:
Hi Cyber-Dragon,

I'm assuming that you are programming a Windows application. If this is the case I think the best approach would be to use the Windows Task Scheduler.  You can read a little more about it and how to use it here:

http://www.codeproject.com/KB/system/taskscheduler.aspx

Good Luck!
0
Cloud Class® Course: Ruby Fundamentals

This course will introduce you to Ruby, as well as teach you about classes, methods, variables, data structures, loops, enumerable methods, and finishing touches.

 
Cyber-DragonAuthor Commented:
Found the resources I was looking for.
0
 
Cyber-DragonAuthor Commented:
Unfortunately after reading up all these sources and Googling, I havnt been able to come up with anything useful. Could some one please post a code sample?
0
 
evilrixSenior Software Engineer (Avast)Commented:
>> Could some one please post a code sample?
Having never used the Scheduler API myself the best I can do is point you a the API, which I've already done. Sorry.
0
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.