in reply to diskpart.exe and perl

Maybe it's just a matter of style, but I would write that as either:

for ( `diskpart rescan` ) { . . . }
or
open FH, "diskpart rescan |" or die "open diskpart|: $!" while (<FH>) { . . . } close FH;
And I think there may be a chomp or two missing in there...

A word spoken in Mind will reach its own level, in the objective world, by its own weight