The Daily Static
  The Daily Static
UF Archives
Register
UF Membership
Ad Free Site
Postcards
Community

Geekfinder
UFie Gear
Advertise on UF

Forum Rules
& FAQ


Username

Password


Create a New Account

 
 

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 Stuka2008-08-22 22:12:35

 

[Todays Cartoon Discussion] [News Index]

Come get yer ARS (Account Registration System) Source Code here!
All images, characters, content and text are copyrighted and trademarks of J.D. Frazer except where other ownership applies. Don't do bad things, we have lawyers.
UserFriendly.Org and its operators are not liable for comments or content posted by its visitors, and will cheerfully assist the lawful authorities in hunting down script-kiddies, spammers and other net scum. And if you're really bad, we'll call your mom. (We're not kidding, we've done it before.)