Use a zero-length file as a sentinel. Use TCSTART to check if it's older than the time since system start (see _WINTICKS) and if so, do your first-time job, then use TOUCH to change the file's time stamp. Now any further invocations of TCSTART will find the file newer than system start, so the job will not be repeated. The benefit (compared with Vince's method) that the file survives repeated logging on/off without system restart, while the volatile variable would force you to execute the task after each logout/login. OTOH that may be what you really want...