Intercept Shutdown - Suspend - WakeAt

nnCron and nnCron LITE discussion

Intercept Shutdown - Suspend - WakeAt

Postby marcusg » Wed, 10 Dec 2008, 05:12

I want to do this:

Watch for a Windows Shutdown
Intercept it and place the PC in Hibernation

Set a WakeAt time for 1.00am

Task 1 - this works fine -
WatchQueryShutdown
Action:
INTERCEPT-SHUTDOWN
POWER-FORCE
POWER-SUSPEND

Task 2 - this never works -
WatchQuerySuspend
Action:
WakeAt: 01:00

Questions:
Can I do this? It appears that if I set power-suspend it is not the same as a PC user manually selecting Standby. It this the case?
These are currently two separate tasks. I've tried merging them, but what order should the functions be in?

Thanks in advance for any advice,

Marcusg
marcusg
 
Posts: 3
Joined: Sat, 06 Dec 2008, 06:41

Re: Intercept Shutdown - Suspend - WakeAt

Postby SeMa » Thu, 11 Dec 2008, 18:31

what is in log?
maybe PC wakes and then goes sleep again in ~5 min?

Code: Select all
#( CLASSIC-TASK-#-Suspend_Timer
\ required plugin http://www.nncron.ru/download/plugins/rstimer.spf
\ this task does not allow to the PC to fall asleep again
NoActive
SingleInstance
0x80000002 CONSTANT ES_CONT_DISPREQ
Action:
BEGIN
ES_CONT-DISPREQ ResetSuspendTimer
PAUSE: 00:02
AGAIN
)#

#( Task1
WatchQueryShutdown
Action:
INTERCEPT-SHUTDOWN
POWER-FORCE       \ --- why? ---
POWER-HIBERNATE
)#

#( Task2
WatchQuerySuspend
Action:
WakeAt: 01:00
CLASSIC-TASK-#-Suspend_Timer LAUNCH
)#
Компьютер ─ устройство, разработанное для ускорения и автоматизации человеческих ошибок
User avatar
SeMa
 
Posts: 637
Joined: Fri, 15 Apr 2005, 12:49
Location: Украина

Re: Intercept Shutdown - Suspend - WakeAt

Postby marcusg » Fri, 12 Dec 2008, 15:21

Thanks SeMa,

I'll review the log and get back to you. Thanks for the tip.

Thanks again,

Marcusg
marcusg
 
Posts: 3
Joined: Sat, 06 Dec 2008, 06:41

Re: Intercept Shutdown - Suspend - WakeAt

Postby marcusg » Wed, 17 Dec 2008, 23:30

OK,

-Downloaded and installed rstimer.spf
-Changed POWER-HIBERNATE to POWER-SUSPEND
-Added a START-APP line for my BitDefender Internet Security software to start.
-Renamed the tasks
-Removed the POWER-FORCE from the WatchQueryShutdown

Here is the code:

#CRONTAB FILE
# Classic crontab format:
# Minutes Hours Days Months WeekDays Years Command
# see 'example.tab'

#( purge-cron-log
Time: 0 12 * * 5 *
Action: PURGE-OLD: "log\*.log" 7
)#

#( CLASSIC-TASK-#-Suspend_Timer
\ required plugin http://www.nncron.ru/download/plugins/rstimer.spf
\ this task does not allow to the PC to fall asleep again
NoActive
SingleInstance
0x80000002 CONSTANT ES_CONT_DISPREQ
Action:
BEGIN
ES_CONT_DISPREQ ResetSuspendTimer
PAUSE: 00:02
AGAIN
)#

#( Watch_Shutdown
WatchQueryShutdown
Action:
INTERCEPT-SHUTDOWN
POWER-SUSPEND
)#

#( Watch_Suspend
WatchQuerySuspend
Action:
WakeAt: 07:00
CLASSIC-TASK-#-Suspend_Timer LAUNCH
START-APP: C:\Program Files\BitDefender\BitDefender 2008\bdagent.exe
)#

It appeared not to work, but the log states:

07:00:38 2772 Start: C:\Program Files\BitDefender\BitDefender 2008\bdagent.exe
07:00:49 2772 Start result: 0
07:04:42 252 TASK: Watch_Suspend

When I checked the PC at 7.14, it had returned to Standby again, but my BitDefender software is running.

Thanks, in advance, for any further advice.

Marcusg
marcusg
 
Posts: 3
Joined: Sat, 06 Dec 2008, 06:41

Re: Intercept Shutdown - Suspend - WakeAt

Postby SeMa » Tue, 30 Dec 2008, 13:47

Try this:
Code: Select all
...
0x80000001 CONSTANT ES_CONT_SYSPREQ
Action:
BEGIN
ES_CONT_SYSPREQ ResetSuspendTimer
...
Компьютер ─ устройство, разработанное для ускорения и автоматизации человеческих ошибок
User avatar
SeMa
 
Posts: 637
Joined: Fri, 15 Apr 2005, 12:49
Location: Украина

Re: Intercept Shutdown - Suspend - WakeAt

Postby Laurac » Sun, 16 Oct 2011, 22:10

Hey,

I dont' know if your on here any more, but can i still use this code now do you know?

Laura
Laurac
 
Posts: 1
Joined: Fri, 01 Jul 2011, 05:57

Re: Intercept Shutdown - Suspend - WakeAt

Postby SeMa » Thu, 20 Oct 2011, 22:44

why not?
Компьютер ─ устройство, разработанное для ускорения и автоматизации человеческих ошибок
User avatar
SeMa
 
Posts: 637
Joined: Fri, 15 Apr 2005, 12:49
Location: Украина

Re: Intercept Shutdown - Suspend - WakeAt

Postby semko » Fri, 21 Oct 2011, 14:15

Maybe she's using Windows 7 which prevents interception of suspend and shutdown?
semko
 
Posts: 46
Joined: Sat, 08 Oct 2005, 17:42
Location: Germany


Return to nnCron forum (English)

Who is online

Users browsing this forum: No registered users and 4 guests