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

Re: get disk usage details like free, used, available for windows drives with sizes in TB

by soonix (Curate)
on Jan 06, 2014 at 10:46 UTC ( #1069481=note: print w/ replies, xml ) Need Help??


in reply to get disk usage details like free, used, available for windows drives with sizes in TB

Filesys::Diskspace seems to be Unix-ish only, Filesys::DfPortable might have problems with NTFS.
A Windows-only solution could involve parsing the output of

`wmic logicaldisk where DriveType="3" get /format:csv`
using Text::CSV. If you don't want to exclude optical drives, mounted shares, etc, you can leave off the where DriveType="3" part.


Comment on Re: get disk usage details like free, used, available for windows drives with sizes in TB
Select or Download Code
Re^2: get disk usage details like free, used, available for windows drives with sizes in TB
by balakrishnan (Monk) on Jan 08, 2014 at 10:40 UTC
    Thanks you so much for your comments..
    The concern here is, Windows 2000 doesnt support wmic.

    I am just looking for the solution which should work in all Windows OS >= Windows 2000.

      Try this:

      C:\Windows\System32>fsutil volume diskfree c: Total # of free bytes : 143714562048 Total # of bytes : 627247673344 Total # of avail free bytes : 143714562048

      With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
      Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
      "Science is about questioning the status quo. Questioning authority".
      In the absence of evidence, opinion is indistinguishable from prejudice.
        already tried the same... command doesnt exist on Windows 2000.
        C:\>fsutil 'fsutil' is not recognized as an internal or external command, operable program or batch file.
        tried and got error as below,

        fsutil is not recognized as an internal or external command

      Another option, you could use DBD::WMI with the following query:

      Select DeviceID,Size,FreeSpace from Win32_LogicalDisk

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (7)
As of 2014-11-22 16:52 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My preferred Perl binaries come from:














    Results (123 votes), past polls