I want a task (.exe) to run everyday at 8:55 am which will span over 30 miniutue.so i created a console application which will start that task(.exe) by using process.start()
.I don't want a sheduler or windowservice rather i am happy with a console application.But the logic used in console application some times fails ie that is not invoking the task (.exe).I create infinite loop by using while(true)
. The code i am posting down(console code),how to correct it
while (true)
{
if (DateTime.Now.Hour == 8 & DateTime.Now.Minute == 55 && DateTime.Now.Second == 0)
{
Process.Start(".exe");//not real code
}
else
Thread.Sleep(1000);
}
EDIT I need to run the task only one time by using console application,not more than that in a day