Hello all,

I've just created DBD::WMI [1], which you can use to query various information on Windows (2000, XP, 2003) computers. My driver is a (very thin) layer between DBI and the Windows WQL query language. The WMI allows you to query various tables ("namespaces"), like the filesystem, currently active processes and events:

    SELECT * FROM Win32_Process

The driver/WMI implements two kinds of queries, finite queries like the query above and potentially infinite queries for events as they occur in the system:

    SELECT * FROM __instanceoperationevent
    WITHIN 1
    WHERE TargetInstance ISA 'Win32_DiskDrive'

This query returns one row (via ->fetchrow_arrayref() ) whenever a disk drive gets added to or removed from the system (think USB stick).

The driver is a very rough draft, lacking documentation, error checking and other stuff, but it works so far. What's on the plan already are DSN parameters to specify the credentials and machine to connect to. Other stuff is welcome - a CPAN release will come soonish.

What helped me greatly were the DBD::File prototype, but more importantly, the DBI::DBD documentation was what made me finish the implementation.

Thanks,
-max

[1] http://datenzoo.de/pub/DBD-WMI-0.02.tar.gz
[*] Daily builds at http://corion.net/perl-dev/

Reply via email to