I want run a process on at a specific time (4:00 AM). Here is my code:
if(Current time == 4:00)
{
ProcessStartInfo autorestart = new ProcessStartInfo(@"C:\Autostart.bat");
autorestart.UseShellExecute = false;
SecureString pw = new SecureString();
pw.AppendChar('p');
pw.AppendChar('a');
pw.AppendChar('s');
pw.AppendChar('s');
pw.AppendChar('w');
pw.AppendChar('o');
pw.AppendChar('r');
pw.AppendChar('d');
autorestart.Password = pw;
autorestart.UserName = "support";
Process.Start(autorestart);
}
else
{
MessageBox.Show("Time not same");
}