XWidgetSoft Forum

XWidget & XLaunchpad , Desktop customization
It is currently May 10th, 2025, 11:36 am

All times are UTC - 8 hours




Post new topic Reply to topic  [ 6 posts ] 
Author Message
 Post subject: schedule to shutdown?
PostPosted: January 18th, 2014, 1:03 am 
Offline

Joined: June 11th, 2013, 10:42 am
Posts: 26
is it possible to schedule to shutdown? to put some time for example 2 hours and after that without confirmation to shutdown pc


Top
 Profile  
 
PostPosted: January 18th, 2014, 2:36 am 
Offline
User avatar

Joined: December 5th, 2012, 5:52 pm
Posts: 4887
I think that someone here has already made a widget like this, but you need to search..

_________________
...and remember: don't take life too seriously...
My profile on Deviantart: http://jimking.deviantart.com/


Top
 Profile  
 
PostPosted: January 18th, 2014, 3:07 am 
Offline

Joined: June 11th, 2013, 10:42 am
Posts: 26
yes you were right
viewtopic.php?f=11&t=3344&hilit=restart


Top
 Profile  
 
PostPosted: January 19th, 2014, 5:47 pm 
Offline

Joined: October 26th, 2013, 8:17 am
Posts: 362
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


Top
 Profile  
 
PostPosted: January 19th, 2014, 11:35 pm 
Offline

Joined: June 18th, 2012, 12:07 am
Posts: 268
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");
}
}


Top
 Profile  
 
PostPosted: January 23rd, 2014, 11:41 pm 
Offline
User avatar

Joined: March 8th, 2013, 10:27 pm
Posts: 353
I think windows already has shutdown scheduling options. See the "shutdown" commands. You can easily !Exec with that

_________________
Life is a myriad game... Just play it!


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 6 posts ] 

All times are UTC - 8 hours


Who is online

Users browsing this forum: No registered users and 49 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  

Powered by phpBB® Forum Software © phpBB Group