#!/C:/perl -w use strict; use File::Find; use Win32API::File qw( getLogicalDrives GetVolumeInformation ); my @drives; use vars qw/*name *dir *prune/; *name = *File::Find::name; *dir = *File::Find::dir; &LocalDrives; foreach my $drive ( @drives ) { File::Find::find(\&wanted, $drive); exit; sub wanted { if (/^VCVARS32.BAT\z/s) { $name =~ s/\///; $name =~ s/\//\\/g; print $name,"\n"; } } } sub LocalDrives { my @scan = getLogicalDrives(); foreach my $d ( @scan ) { my @x= (undef)x7; GetVolumeInformation( $d, @x ); if ($x[0] =~ /Local Disk/) { push @drives, $d; } } }