I have been looking for this information for a while, and I have several ways to get a list of local drives under Windows. Here are two examples:
print win32api.GetLogicalDriveStrings().split("\x00")
and
def getDriveLetters(self): self.drvs = [] n_drives = win32api.GetLogicalDrives() for i in range(0,25):
What I cannot find is a way to separate floppy disks (A :), USB-drives (G :), CD-ROMs (E :) and network drives (P :) from local hard drives (C :, D: )
If the same letters were assigned to all of them, it would be easy, but I am writing this script to control the local space on the hard drive in a network of computers with different configurations.
Any help would be appreciated! Thanks.
Nathan garabedian
source share