Created
November 19, 2019 10:20
-
-
Save RDCH106/e3079526d403c422e9790f6a4e8d7877 to your computer and use it in GitHub Desktop.
Show free space for all logical disks
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
try: | |
import wmi | |
except ImportError as e: | |
print(e) | |
print("Please, install wmi package using 'pip install wmi'") | |
exit(-1) | |
c = wmi.WMI () | |
for d in c.Win32_LogicalDisk(): | |
print( d.Caption, str(round(int(d.FreeSpace) / 1073741824, 2)) + " GB") | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment