Chandrakant Tiwari wrote: > Hi All, > This is Chandrakant Tiwari. > > I need to write a small program in C which should shut down my computer and > restart it back 100 times and each time it should log the system time in a > log file. My concern here is once the system will be restarted how will that > program will get loaded into the system and retain the value of program > counter and other values? > > Any input on this will be a great help! > > Thanks in advance. > > Regards, > CT
Given that this is OS-specific, you are going to have to specify your OS. In general, you would put your program into the startup sequence. Getting the program to run on startup is likely no problem but getting it to stop could be. You also have the issue of programs that start after or while your program is starting. Windows, in particular, simply starts all the programs simultaneously and therefore everything takes forever to load. If your program starts, it'll shut down the computer before everything is loaded. Telling if everything is finished loading is going to be difficult. Seems like a silly program. A stopwatch, paper, and pencil would be a lot easier. -- Thomas Hruska CubicleSoft President Ph: 517-803-4197 *NEW* MyTaskFocus 1.1 Get on task. Stay on task. http://www.CubicleSoft.com/MyTaskFocus/
