Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.
Keywords: Detect Determine Standby or Hibernate Power Management Event
objWinmgmts = ObjectGet("winmgmts:") colMonitoredEvents = objWinmgmts.ExecNotificationQuery("Select * from Win32_PowerManagementEvent") While @TRUE objLatestEvent = colMonitoredEvents.NextEvent ;Message( "A power management event happened", "Event type: ":objLatestEvent.EventType) Switch objLatestEvent.EventType Case 4 ;Entering suspend, Message( "PowerManagementEvent", "Entering suspend") Break Case 7 Message( "PowerManagementEvent", "Resuming from suspend") Break Case 11 Message( "PowerManagementEvent", "OEM Event happened OEMEventCode = " : objLatestEvent.OEMEventCode) Break Case 18 Message( "PowerManagementEvent", "Resume Automatic happened") Break EndSwitch EndWhile objWinmgmts = 0
Article ID: W18469
Filename: Detect Standby or Hibernation Event.txt
File Created: 2010:06:23:12:42:56
Last Updated: 2010:06:23:12:42:56