in reply to Locating a flash drive on windows


Hi,

I use the following to get drive info on Windows XP.

use Win32API::File qw( :Func ); %driiv_name = (); @drives_volumes = (); @driivs = (); sub find_drives { eval{ @driivs= getLogicalDrives(); }; if( $@ ) { my $msg = $mw->MesgBox( -title => 'Fatal Error.', -text => "No Logical Drives found.", -icon => 'ERROR', -buttons => ['OK'] )->Show; } my $lup = 0; my $endlup = scalar( @driivs ); while( $lup < $endlup ) { $sRootPath = $driivs[$lup]; GetVolumeInformation( $sRootPath, $osVolName, $lVolName, $ouSerialNum, $ouMaxNameLen, $ouFsFlags, $osFsType, $l +FsType ); $drives_volumes[$lup] = sprintf "%-5s%15s", $sRootPath, $osVol +Name ; $driiv_name{$drives_volumes[$lup]} = $sRootPath; $lup++; } $FS_Tname = $drives_volumes[0]; $FD_Tname = $drives_volumes[0]; }


This is a stripped down version.
Hopefully I haven;t taken out anything vital.

J.C.