Posted on 2012-03-30
I am creating a windows service that should run every hour, check database for a reboot date and time and schedule reboot based on the datetime it finds in the database.
I can use Windows scheduler to schedule my windows service and I took care of the data retrieval part. Now I am trying to find the best way to schedule a reboot based on the retrieved value.
Should I use the registry HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer? if so, could you give me an example?
or should i use System.Diagnostics.Process.Start("ShutDown", "/r")?
Also before a reboot I want to show the user a messagebox warning.
Can anyone help?