I am trying to get this to work....it first uses FSUTIL to get the
current drives, then what king of drives, they are, if they are read/
write drives I want to search for a specific file and delete it.. This
is what I have so far..
open(FSUTIL,"fsutil fsinfo drives | ");
while (<FSUTIL>) {
$DRIVES=$_;
}
close(FSUTIL);
chop $DRIVES;
chop $DRIVES;
$DRIVES=~ s/Drives://;
#print "DRIVES:[$DRIVES]";
@drive=split(/\\/,$DRIVES);
foreach $letter (@drive) {
print "Searching drive:$letter\n";
open(FSUTIL,"fsutil fsinfo drivetype $letter|");
while (<FSUTIL>) {
$DRIVETYPE= $_;
}
close(FSUTIL);
print "DRIVETYPE:$DRIVETYPE\n";
if ( grep("Fixed Drive",$DRIVETYPE) != "" ) {
print "HIT\n"; ("this is just a test to see if it worked)
}
then from here I need to search said drive(s) for a specific file and delete that file...Im stuck
Tags: