XWidgetSoft Forum
https://bbs.xwidget.com/

schedule to shutdown?
https://bbs.xwidget.com/viewtopic.php?f=8&t=3998
Page 1 of 1

Author:  tasmani2606 [ January 18th, 2014, 1:03 am ]
Post subject:  schedule to shutdown?

is it possible to schedule to shutdown? to put some time for example 2 hours and after that without confirmation to shutdown pc

Author:  Jimking [ January 18th, 2014, 2:36 am ]
Post subject:  Re: schedule to shutdown?

I think that someone here has already made a widget like this, but you need to search..

Author:  tasmani2606 [ January 18th, 2014, 3:07 am ]
Post subject:  Re: schedule to shutdown?

yes you were right
viewtopic.php?f=11&t=3344&hilit=restart

Author:  hamid [ January 19th, 2014, 5:47 pm ]
Post subject:  Re: schedule to shutdown?

tasmani2606 wrote:
is it possible to schedule to shutdown? to put some time for example 2 hours and after that without confirmation to shutdown pc

the command for shutdown without confirmation is: "!ShutdownNoConfirm"
you can use it in code in this way:
Code:
widget.cmd("!ShutdownNoConfirm")


you can use it in your previously created widget: [count-down timer]
(just replace playsound line with this line or add it next to it)
viewtopic.php?f=8&t=3767

Author:  meme [ January 19th, 2014, 11:35 pm ]
Post subject:  Re: schedule to shutdown?

This may be of interest, I use this code to shutdown my system every night at a set time, which is adjustable from the widget, is also includes the option to cancel the shutdown if you are still using your PC when the shutdown is triggered. OffHour OffMinute and a checkbox for enable/disable are used to configure the widget. The values for these variables are saved and loaded in the config.ini file, this part is not included here.

function datetimecore1OnUpdate(Sender) // every 1 second ///System Shutdown///
{
var NowDate = new Date();
var NowHour = NowDate.getHours();
var NowMin = NowDate.getMinutes();
var NowSec = NowDate.getSeconds();
//var OffHour = NowHour; //OffHour will be set by user
//var OffMin = NowMin; //OffMin will be set by user

if(NowHour == OffHour && NowMin == OffMin && NowSec == 0 && checkbutton1.Checked == -1)
{ //shutdown if time match and enabled
run("shutdown.exe -s -t 30");
var answer = Confirm("Abort Shutdown ?") // ask user to abort shutdown
if (answer)
run("shutdown.exe -a");
}
}

Author:  digigamer [ January 23rd, 2014, 11:41 pm ]
Post subject:  Re: schedule to shutdown?

I think windows already has shutdown scheduling options. See the "shutdown" commands. You can easily !Exec with that

Page 1 of 1 All times are UTC - 8 hours
Powered by phpBB® Forum Software © phpBB Group
http://www.phpbb.com/