Hi, I am trying to create a widget that will allow the user to set a time that the computer will shutdown every night.
This code works, shutting down at the set time and asking the user to abort the shutdown if required.
But if the user does not respond to the "Confirm" abort shutdown request it will remain active, while the system is shutting down.
Is there a way to dismiss the confirm request with a setTimeout? or another method all together ?
Thank you for your help
function TimedShutdown()
{
var NowDate = new Date();
var NowHour = NowDate.getHours();
var NowMin = NowDate.getMinutes();
var OffHour = NowHour; //OffHour will be set by user
var OffMin = NowMin; //OffMin will be set by user
if(NowHour == OffHour && NowMin == OffMin) //shutdown if time match
run("shutdown.exe -s -t 60");
//setTimeout("doSomething()",10000); //can it be used to dismiss the confirm ?
var answer = Confirm("Abort Shutdown ?") // ask user to abort shutdown
if (answer)
run("shutdown.exe -a");
}