Getting an overview if all available driveletters on NT

Ulf Engstrøm ulf.engstrom at b2b-link.com
Wed Apr 12 01:45:36 EDT 2000


As the effbot told you the win32api is probably the one you wanna use, but
the function is GetLogicalDriveStrings() This won't gives you all the the
driveletters, but not their labels, there might be something like that
there, just never have had to use it. Someone else might now that part?
>>> win32api.GetLogicalDriveStrings()
'A:\\\000C:\\\000D:\\\000E:\\\000'
Regards
Ulf

> Pieter Claerhout <PClaerhout at CREO.BE> wrote:
> > is there a module in Python, which can list all available driveletters,
> together with
> > their label. I'm using Windows NT? I already thought of iterating over
all
> possible
> > driveletters, and see if the path exists or not, but I also want to
> separate the
> > network volumes from the other volumes. Any ideas?
>
> just guessing here (don't have win32api on this box),
> but this might do the trick:
>
>     type = win32api.GetDriveType("%s:\\" % drive)
>
> where drive is 'A' through 'Z'.
>
> </F>
>
>
> --
> http://www.python.org/mailman/listinfo/python-list





More information about the Python-list mailing list