NetServerDiskEnum in win32net

Uwe Becher ubecher at
Fri Aug 29 16:51:57 CEST 2003

Tim Golden wrote:
> Uwe Becher <ubecher at> wrote in message news:<bilh88$rs3$03$1 at>...
>>I try to get all logical drives of a remote machine (WinNT or W2K) and 
>>get a result, that gives me the expected total but not all expected drives.
>> >>> win32net.NetServerDiskEnum('nor1w020', 0) gives me:
>>([u'A:', u'', u'C:', u'', u'D:', u'', u'E:', u''], 8, 0)
>>while the machine has the local drives
>>A: C: D: E: F: G: H: Z:
>>A: - Floppy
>>Z: - CDROM
>>All others are harddisk partitions on two physical drives
>>Does anyone have an idea?
> I had the same problem, and to my shame I didn't raise it as a bug, I
> simply bypassed it (because my DBA needed the info immediately anyway)
> by using wmi. Have a look at
> and then try something
> like this:
> <code>
> import wmi
> c = wmi.WMI ("") # or whatever host name
> for disk in c.Win32_LogicalDisk (DriveType=3):
>   print disk.Caption
> </code>

that did the job, thanks!

More information about the Python-list mailing list