disk usage

Started by kle2, April 28, 2022, 05:14:55 AM

Previous topic - Next topic

kle2

I am trying to get the disk usage (C: D: E: etc...) remotely (or at least locally) for Windows servers.  Do you have any suggestion/command?  Thank you - Khoa

ChuckC

WMI [Windows Management Instrumentation] can be utilized in a WinBatch script.  Specifically, the class Win32_LogicalDisk can provide the information that you're looking for.  WMI can access both the local computer and remote computers, provided that the remote computers are configured to allow inbound requests to interact with WMI.

I'd recommend first searching the tech support database for articles about using WMI from WinBatch, do some reading and try out some of the script code in those articles.  Demonstrate to yourself that you can make it work.  Then adapt that code to specifically query a computer for all instances of Win32_LogicalDisk, iterate through them and obtain the desired information from each instance.

kle2


td

WinBatch also has the "DiskFree" function which reports the amount of unused disk space. You can find more information in the functions documentation in the Consolidated WIL Help file. The "Diskscan" function will obtain a list of drive letters.
"No one who sees a peregrine falcon fly can ever forget the beauty and thrill of that flight."
  - Dr. Tom Cade

kle2