If Windows:
Task Scheduler is your best bet, and this is a good resource (and yes, I did just copy those links from the comments on the question. Credit where credit is due).
But really, Googling "task scheduler" should give you a wealth of helpful information. Since Task Scheduler comes by default with Windows, and it's put out by Microsoft, favor links to Microsoft's sites (as their documentation will be more extensive).
edit: I would also refer you to Jonny Wright's answer, as it gives a helpful and clear walkthrough.
If Linux / UNIX
You'll want to use cron
or at
. Be aware than the crontab syntax for per-user crontab is not the same as for global crontab, and if you put scripts in /etc/cron.daily/
or one of the other frequency-specific cron directories you can use any format of script.
You can also simply add the functionality you want to one of the init scripts (or, better yet, write your own init script) that forks a subprocess which performs the action you want.
For example, putting a file like the one below under /etc/init.d
would cause it to run at boot time:
#!/usr/bin/env bash
mything ()
{
# Wait five minutes; 5 * 60 seconds
sleep $(( 5 * 60 ))
# Do the thing you want to do
exampleprogram exampleArg1 exampleArg2
}
mything & >/dev/null
All of those links, by the way, are just to manpages, so to access them you'd use:
man 1 crontab
(for per-user crontab syntax), man 5 crontab
(for global crontab syntax), man cron
(for cron syntax), and man at
(for at syntax).
Either Way
Be aware that, to schedule an event relative to the boot time of the machine you will need administrative / superuser privileges, while you won't need admin privileges to schedule an event relative to your own login time.