PC Review


Reply
Thread Tools Rate Thread

Detection of Standby or Hibernate mode

 
 
=?Utf-8?B?RUNM?=
Guest
Posts: n/a
 
      13th Oct 2003
During standby or hibernate operation, is there any way to detect if it is an automatic (system initiative ->timeout which is configured in power management was expired) or manual operation (button press by user for example) and if it is hibernate or standby operation?

Any help would be greatly appreciated.
Thanks in advance

Regards,
Eric

 
Reply With Quote
 
 
 
 
Torgeir Bakken (MVP)
Guest
Posts: n/a
 
      13th Oct 2003
ECL wrote:

> During standby or hibernate operation, is there any way to detect if it is an automatic (system initiative ->timeout which is configured in power management was expired) or manual operation (button press by user for example) and if it is hibernate or standby operation?


Hi

You can use the WMI Win32_PowerManagementEvent to detect a standby event (and maybe other things as well). Try the script below and see what you get as result.

Win32_PowerManagementEvent WMI class
http://msdn.microsoft.com/library/en...ementevent.asp

A vbscript example (will loop forever until terminated):

Set colMonitoredEvents = GetObject("winmgmts:")._
ExecNotificationQuery("Select * from Win32_PowerManagementEvent")

Do
Set strLatestEvent = colMonitoredEvents.NextEvent
Select Case strLatestEvent.EventType
Case 4
MsgBox "Entering suspend."
Select Case strLatestEvent.EventType
Case 7
MsgBox "Resuming from suspend."
Case 11
MsgBox "OEM Event happened, OEMEventCode = " _
& strLatestEvent.OEMEventCode
Case 18
MsgBox "Resume Automatic happened"
End Select
Loop


--
torgeir
Microsoft MVP Scripting and WMI, Porsgrunn Norway
Administration scripting examples and an ONLINE version of the 1328 page Scripting Guide: http://www.microsoft.com/technet/scriptcenter


 
Reply With Quote
 
New Member
Join Date: Dec 2011
Posts: 1
 
      10th Dec 2011
I realise that this is a very old post, but I'm hoping that someone will still be monitoring the thread. I have tried very hard to use this information to detect whether my system comes out of hibernation due to a scheduled task (automatically) or due to user input from a wireless keyboard (manually). Every time the system awakens, it fires code 7 first, and code 18 soon thereafter. It does not seem to matter what actually awakens the system; both codes fire every time. Any ideas?
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Do web services run in standby or hibernate mode? =?Utf-8?B?TWF0ZXVzeiBSYWpjYQ==?= Windows XP Networking 2 26th Jan 2006 03:45 AM
Does not go to standby or hibernate mode Chan Ron Windows XP General 1 13th Jun 2004 07:49 AM
standby/hibernate =?Utf-8?B?Q3VyYm1hc3Rlcg==?= Windows XP General 2 11th Mar 2004 12:26 PM
Standby/Hibernate mode Lenny Windows XP General 7 9th Feb 2004 11:23 PM
Detection of Standby or Hibernate mode ECL Windows XP General 3 16th Oct 2003 11:43 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 01:49 AM.