WinBatch Tech Support Home

Database Search

If you can't find the information using the categories below, post a question over in our WinBatch Tech Support Forum.

TechHome

WMI
plus
plus

Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.

Detect Resume from Standby


Question:

Is there a way of detecting when a pc/laptop has resumed from standby ?

Answer:

The following is a translation of simple MSFT example. You need to us task manager to kill it.
objWinmgmts = ObjectGet("winmgmts:")
colMonitoredEvents = objWinmgmts.ExecNotificationQuery("Select * from Win32_PowerManagementEvent")

While @TRUE
    objLatestEvent = colMonitoredEvents.NextEvent
    Message( "A power management event happenned", "Event type: ":objLatestEvent.EventType)
EndWhile
objWinmgmts = 0

Article ID:   W18468
Filename:   Detect Resume From Standby.txt
File Created: 2008:08:25:08:40:22
Last Updated: 2008:08:25:08:40:22