Determination of disk types

Tim Golden tim.golden at
Mon Jan 9 11:02:03 CET 2006


| Is there a way to determine which drive letter is a FDD, a local disk,
| a CD-ROM/COMBO Drive, or a mapped network drive?
| I wrote a script to identify all the drive letters on my Windows XP
| system. Now I want to determine their type, too.

Initial quick reposnse: look at WMI. Something like
the following could get you going:

WMI info from MS:
Python module:

import wmi

c = wmi.WMI ()
for disk in c.Win32_LogicalDisk ():
  print disk


You probably want to look at the DriveType and MediaType
attributes, and you may well want to look into other
classes such as Win32_DiskDrive. WMI often involves a
fair bit of poking around to find the info you need.

Fortunately if you can find someone who's answered the
question in some other language, perhaps on the WMI
newsgroups, you can easily translate that into Python.


This e-mail has been scanned for all viruses by Star. The
service is powered by MessageLabs. For more information on a proactive
anti-virus service working around the clock, around the globe, visit:

More information about the Python-list mailing list