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.
Local drives in Windows

Local drives in Windows

Find out all local drives in Window. No network-drives, please.
#!/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 $drive (@drives) {
    print "\tDrive $drive\n";
}
@drives = Win32::AdminMisc::GetDrives();
print "These are ALL drives here:\n";
foreach $drive (@drives) {
    print "\tDrive $drive\n";
}
Impressum