in reply to Re^3: Error with GetDRIVE() when using a mapped drive
in thread Error with GetDRIVE() when using a mapped drive
#!perl use warnings; use strict; use Win32::OLE; my $fs = Win32::OLE->CreateObject('Scripting.FileSystemObject'); my $d = $fs->GetDrive('Y:') or die "GetDrive failed $!"; my $TotalSize = $d->{TotalSize}; my $FreeSpace = $d->{FreeSpace}; my $usedSpace = $d->{TotalSize} -= $d->{FreeSpace}; my $AvailableSpace = $d->{AvailableSpace} *=100; my $AvailUsed = $AvailableSpace /= $d->{TotalSize}; my $SpaceLeft = $d->{AvailableSpace} /= $AvailUsed; my $MappedDriveSpaceAvailable = $AvailUsed *= 100; print "em_result=$MappedDriveSpaceAvailable";
Now, there are the errors
GetDrive failed Bad file descriptor at E:\APPL\OEM\NetworkDriveCheck.pl line 9.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^5: Error with GetDRIVE() when using a mapped drive
by soonix (Chancellor) on Nov 04, 2014 at 20:12 UTC | |
by vanz (Initiate) on Nov 04, 2014 at 21:45 UTC | |
by soonix (Chancellor) on Nov 05, 2014 at 08:25 UTC | |
by vanz (Initiate) on Nov 11, 2014 at 21:05 UTC | |
by soonix (Chancellor) on Nov 13, 2014 at 11:50 UTC |