Discussion:
Determination of disk types
Mondal
2006-01-09 06:19:52 UTC
Permalink
Hello,

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.

Thanks for your help, in advance.

Regards
Mondal
Tim Golden
2006-01-09 10:02:03 UTC
Permalink
[Mondal]

| 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:
http://msdn.microsoft.com/library/en-us/dnanchor/html/anch_wmi.asp
Python module: http://timgolden.me.uk/python/wmi.html

<code>
import wmi

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

</code>

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.

TJG

________________________________________________________________________
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:
http://www.star.net.uk
________________________________________________________________________
Mondal
2006-01-12 10:01:52 UTC
Permalink
Hi,

Thanks for the info. That was quite useful. I will surely poke around
wmi.

Thanks again

Regards
Mondal

Continue reading on narkive:
Loading...