Still no joy. Here's the current code:
use Win32::DriveInfo; use constant { SECTORS_PER_CLUSTER => 0, BYTES_PER_SECTOR => 1, FREE_CLUSTERS => 2, TOTAL_CLUSTERS => 3, BYTES_FREE_4_CALLER => 4, TOTAL_BYTES => 5, TOTAL_FREE => 6, }; #$sql = "\\\\server01\\d\$"; $sql = "c:"; print "$sql\n"; print "Drive Free Tot PctFree\n"; my @info = Win32::DriveInfo::DriveSpace($sql) or die "DriveSpace failed with error: $^E"; printf "%.3f GB free of total %.3f GB\n", $info[ TOTAL_FREE ] / 1024**3, $info[ TOTAL_BYTES ] / 1024**3;
If I run it against the server specified in the line that's commented out, it returns zeroes and no error. If I run it against my C:, it returns accurate numbers. So I don't think it's going out to the network, yet it isn't returning an error.

Here's the output of two runs:
c:\Perl>drivelist.pl \\server01\d$ Drive Free Tot PctFree 0.000 GB free of total 0.000 GB c:\Perl>drivelist.pl c: Drive Free Tot PctFree 31.639 GB free of total 74.444 GB

In reply to Re^2: Trying to get drive space info on remote Windows servers by Cloudster
in thread Trying to get drive space info on remote Windows servers by Cloudster

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.