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

Posted on 2009-04-16
Last Modified: 2013-12-14
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?
Question by:Cyber-Dragon
    LVL 39

    Assisted Solution

    >> 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?

    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.
    LVL 39

    Accepted Solution

    >> Have you tried looking at the Windows tack scheduler?
    Heres the relevant SDK documentation for the Windows task scheduler.
    LVL 1

    Assisted Solution

    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:

    Good Luck!

    Author Closing Comment

    Found the resources I was looking for.

    Author Comment

    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?
    LVL 39

    Expert Comment

    >> 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.

    Featured Post

    Find Ransomware Secrets With All-Source Analysis

    Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

    Join & Write a Comment

    Jaspersoft Studio is a plugin for Eclipse that lets you create reports from a datasource.  In this article, we'll go over creating a report from a default template and setting up a datasource that connects to your database.
    Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
    The viewer will learn how to synchronize PHP projects with a remote server in NetBeans IDE 8.0 for Windows.
    The viewer will learn how to pass data into a function in C++. This is one step further in using functions. Instead of only printing text onto the console, the function will be able to perform calculations with argumentents given by the user.

    728 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    18 Experts available now in Live!

    Get 1:1 Help Now