Just create a program that 1) Appends the current date/time to your log file. 2) Opens a 'counter' file, reads in the number, increments it, and writes the new number to that file. 3) If the number written is < 100, calls system() with shutdown -r -t 5
The '5' is the number of seconds after invocation that the system will reboot. You may want a longer delay in there to allow the system to start up properly or give you time to allow you to kill your process if you want to stop it prematurely. Place the program in your startup folder. In addition you will want to arrange it so that you don't need to enter any login credentials on starting. <http://support.microsoft.com/kb/315231> On Fri, Sep 19, 2008 at 10:25 AM, Chandrakant Tiwari <[EMAIL PROTECTED]> wrote: > Hi, > Thanks for your reply. > > I am using Microsoft Windows XP professional verison 2002, SP-2. > > Thanks, > CT > On Thu, Sep 18, 2008 at 7:25 PM, Nico Heinze <[EMAIL PROTECTED]> wrote: > >> --- In [email protected] <c-prog%40yahoogroups.com>, "Chandrakant >> Tiwari" <[EMAIL PROTECTED]> >> 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? >> >> There is no general answer to this question. Such things can be done, >> but it depends completely on the operating system you work with. >> >> So you first have to tell us what OS in which exact version you use, >> then you might get some detailed reply. >> >> Regards, >> Nico >> -- PJH http://shabbleland.myminicity.com/
