#! perl -slw use strict; use Win32::API::Prototype; ApiLink( 'DiscIdCalcDLL', q[ int GetCdRomDrives( LPVOID p ) ], ) or die $^E; my $struc = chr(0) x ( 4 + 1036*3 ); GetCdRomDrives( $struc ) or die $^E; print "'$_'" for unpack 'v( VVV (a256)4 )3', $struc; __END__ c:\test>DiskId.pl '0' '0' '0' '0' ' ' ' ' '0' '0' '0' ' ' ' ' '0' '0' '0' ' ' ' ' #### #! perl -slw use strict; use DBI; my $dbh = DBI->connect('dbi:WMI:'); my $sth = $dbh->prepare(<execute(); while( my @row = $sth->fetchrow ) { printf "Caption: %25s Name:%30s Drive; %s\n", @row; } __END__ c:\test>junk Caption: HL-DT-ST CD-ROM GCR-8481B Name: HL-DT-ST CD-ROM GCR-8481B Drive; R: Caption: LITE-ON DVDRW SOHW-1693S Name: LITE-ON DVDRW SOHW-1693S Drive; D: #### Availability Capabilities CapabilityDescriptions Caption CompressionMethod ConfigManagerErrorCode ConfigManagerUserConfig CreationClassName DefaultBlockSize Description DeviceID Drive DriveIntegrity ErrorCleared ErrorDescription ErrorMethodology FileSystemFlags FileSystemFlagsEx Id InstallDate LastErrorCode Manufacturer MaxBlockSize MaximumComponentLength MaxMediaSize MediaLoaded MediaType MfrAssignedRevisionLevel MinBlockSize Name NeedsCleaning NumberOfMediaSupported PNPDeviceID PowerManagementCapabilities PowerManagementSupported RevisionLevel SCSIBus SCSILogicalUnit SCSIPort SCSITargetId Size Status StatusInfo SystemCreationClassName SystemName TransferRate VolumeName VolumeSerialNumber