|
|
Back to UserFriendly Strip Comments Index
| Requesting logic check |
by jpprater |
2008-08-22 14:21:02 |
I'm working on learning WMI, and I'm trying to understand the whole event concept. Tell me if this seems reasonable to you:
Problem: I need to detect the event of a removable disk being inserted into a computer (i.e. a USB flash drive).
Fact: WMI provides a class called __InstanceCreationEvent, which informs WMI event consumers that an instance of something was just created.
Fact: WMI also provides a class called Win32_LogicalDisk, whose instances describe various disks that are currently available in the system.
Supposition: If all drives on a computer are represented by instances of Win32_LogicalDisk, then the insertion of a removable drive should trigger the creation of a new instance.
Proposed Solution: I can register an event query for the creation of any instance of Win32_LogicalDisk where the instance's DriveType property equals 2 (representing a removable disk).
Seems logical enough, yes? I've been told by others that WMI doesn't work this way, but I'll test this when I get home (I should have left work 20 minutes ago...) |
|
[ Reply ] |
|
Have you read this? | by Stuka | 2008-08-22 22:12:35 |
|
|
[Todays Cartoon Discussion]
[News Index]
|
|