Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

netspace.pl

by ergowolf (Monk)
on Apr 27, 2000 at 17:54 UTC ( #9397=sourcecode: print w/replies, xml ) Need Help??
Category: NT admin
Author/Contact Info ergowolf
Description: see the pod bellow
use strict;
use Win32::AdminMisc;
use Win32::NetResource;

my $drive;
my $free;
my $total;
my $unc;                        
my $low = "1000";
my @netdrv = Win32::AdminMisc::GetDrives( DRIVE_REMOTE );
my $VERSION = 1.0;

print "The drives bellow have less than 1 GB free:\n\n"; 

foreach $drive (@netdrv) {
($total, $free) = Win32::AdminMisc::GetDriveSpace($drive);
Win32::NetResource::GetUNCName( $unc, $drive );
$free = $free / 1048576;

    if ($free < $low) {
    print "$unc is mapped to $drive drive has $free MB free\n\n";
    }
    
}

=head1 NAME

netspace - This script grabs a list of all the network drives your wor
+kstation is connected to and prints out how much space is left on the
+ drive if it is less than 1 GB.

=head1 DESCRIPTION

This program is useful for quickly getting a list of drives low on spa
+ce.

=head1 README

This program is useful for quickly getting a list of drives low on spa
+ce.

=head1 PREREQUISITES

This script has a few requirements.  You will need the Win32::AdminMis
+c and Win32::NetResource modules.

=head1 COREQUISITES

None

=pod OSNAMES

MSWin32

=pod SCRIPT CATEGORIES

Win32/Utilities 

=cut
Replies are listed 'Best First'.
Re: netspace.pl
by Anonymous Monk on Mar 11, 2002 at 17:45 UTC
    needed perlcrt.dll, after installing now dr watson with the AdminMisc mod - ooerrr :(
Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: sourcecode [id://9397]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (5)
As of 2016-09-27 05:25 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Extraterrestrials haven't visited the Earth yet because:







    Results (494 votes). Check out past polls.