Hi André,
jetzt muss ich wohl mal meine DOS-Kenntnisse auffrischen gehen?! ;-)
ne, musst nicht ;-)
Btw., ich werde auch davon wegkommen, nach https://forum.selfhtml.org/?t=158363&m=1029706 bin ich schon dabei, meine Backuplösung komplett auf PERL umzustellen.
Viele Grüße,
Ernst
Der Anfang ist gemacht,
Laufwerksbuchstaben anhand Label ermitteln:
#!/usr/bin/perl -w
###########################################################################
# VARs
my @driveLetters = qw( f g h i j k );
my $label = 'Volume';
###########################################################################
use strict;
use Win32::DriveInfo;
my $LW = getDriveLetterByLabel(\@driveLetters, $label) or die "Drive not found\n";
print "$LW\n";
exit;
###########################################################################
sub getDriveLetterByLabel{
my ($dls, $labl) = @_;
foreach my $dl(@$dls){
my ($VolumeName, @trash) = Win32::DriveInfo::VolumeInfo($dl);
if( $VolumeName && ($VolumeName eq $labl)){ return($dl) }
else { next }
}
return;
}