Receiving Events for the Duration of Your Application
One of the most common ways to receive an event is through a running application, such as a management application that collects and displays events to a user. Such applications are called "temporary" because a temporary consumer does not receive event notifications when shut down.
A temporary consumer calls SWbemServices.ExecNotificationQuery in script or IWbemServices.ExecNotificationQuery in C++ to subscribe to events in a namespace. The identity associated with this subscription is the caller.
A temporary event consumer can receive notifications either asynchronously or semisynchronously in both scripts and C++.