Skip to content

Commit

Permalink
Added a timer to shutdown to avoid shutting down prematurely
Browse files Browse the repository at this point in the history
  • Loading branch information
JonasNilson committed Aug 26, 2018
1 parent 50edbc4 commit 8024bb9
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion Source/IdleMaster/frmMain.cs
Original file line number Diff line number Diff line change
Expand Up @@ -505,10 +505,14 @@ public void IdleComplete()
Height = Convert.ToInt32(scale);
if (shutdown.Checked)
{
var psi = new ProcessStartInfo("shutdown", "/s /t 0");
// Start a separate process to shut down Windows (30 sec timer)
var psi = new ProcessStartInfo("shutdown", "/s /t 30");
psi.CreateNoWindow = true;
psi.UseShellExecute = false;
Process.Start(psi);

// Close the application
Form1_Closing(this, null);
}
}

Expand Down

0 comments on commit 8024bb9

Please sign in to comment.