namespace wmi
import System
import System.Management
import System.Collections
query = """SELECT * FROM Win32_LogicalDisk
where drivetype=3"""
searcher = ManagementObjectSearcher("root\\CIMV2",query)
results = searcher.Get()
for b as ManagementObject in results:
print b.Properties["DeviceID"].Value,b.Properties["Size"].Value
print "Press any key to continue . . . "
Console.ReadKey(true)
No comments:
Post a Comment