Home

Search this site:
 

Horshack’s
very
own site

 

This is Bavaria, Germany!
You will find links to Perl,
bootdisks for system administration,
a lot of Linux,
Windows administration
and some personal belongings.
Find available space on local drives

Find available space on local drives

#!/usr/bin/perl
use strict;
use warnings;
use Win32::AdminMisc;
use Win32::NetAdmin;

# which drives are available, possible parameters are:
# DRIVE_REMOTE
# DRIVE_FIXED
# DRIVE_CDROM
# DRIVE_REMOVABLE
my @drives = Win32::AdminMisc::GetDrives(DRIVE_FIXED);
print "These fixed drives are available:\n";
foreach my $drive (@drives) {
    print "\tDrive $drive\n";

    my ( $size, $free ) = Win32::AdminMisc::GetDriveSpace($drive);
    print "\t\tsize is $size Bytes\n";
    print "\t\tfree is $free Bytes\n";
}
Impressum