Win32 Drive List Redux

Tim Golden tim.golden at viacom-outdoor.co.uk
Fri Jan 3 03:55:19 EST 2003


Tim Daneliuk <tundra at tundraware.com> wrote in message news:<eop2va.igo2.ln at boundary.tundraware.com>...
> Tim Daneliuk wrote:
> > Some time ago, there was a brief thread on how to get a list of
> > available drives on Win32.  Peter Hansen suggested the use of:
> <SNIP>
> 
> Well, here is a "Sort-Of" solution. It suffers from the fact that it is
> not in sync with reality of the machine - it reports B: on my system
> (which has none) and incorrectly shows a network drive that has been
> detatched.  

<... snip solution using _winreg ...>

I was going to post and point out that DOS has long recognised B: as
an alternative "mount point" (for want of a better expression) for A:
when copying disk to disk. ie you could do "diskcopy a: b:" even if
your system only had one drive, and you would be prompted to swap
disks. Maybe that's why it offers B: as a mount point.

Having said that, I ran the script on my (Python 2.1.3 on Win2000 SP2)
setup, and it gave me a 1: drive (that's the digit one!), A:, *no* B:
drive, then C: and a clutter of other drives which have at some point
been mounted across the network. Interesting!

I freely admit I haven't tried browsing MSDN to find out what this
particular reg key is supposed to give you.

TJG




More information about the Python-list mailing list