Based on your comment in reply, you what to:
1. Update a registry value every 5 min. in your Winform program and ONLY when your program is running.
Then look at
System.Windows.Forms.Timer[
^] or
System.Timers.Timer[
^]
Use System.Timers.Timer if do not want to block UI interface.
See the example under these two links.
-----------
Use Windows Task Scheduler.
Schedule your program to run every 5. min.
Windows service scheduled to run at specific interval[^]
Under "Command Prompt" type: SCHTASKS
And follow instructions.