Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
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

Comment on netspace.pl
Download Code
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 :(

Back to Code Catacombs

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: (9)
As of 2015-03-02 15:12 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    When putting a smiley right before a closing parenthesis, do you:









    Results (48 votes), past polls