FAQ
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.

Example:
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?

Thanks
Uwe

Search Discussions

  • News M Claveau /Hamster-P at Aug 28, 2003 at 8:49 pm
    Hi !

    I try, and i have same result. But, i have no read doc...

    --
    Michel Claveau
  • Roger Upole at Aug 29, 2003 at 2:13 am
    There's a bug in this function. (also a related memory leak)
    I've been meaning to submit a patch for it, but I hadn't heard
    anybody else complain about it yet.
    Roger


    "Uwe Becher" <ubecher at gmx.net> wrote in message
    news:bilh88$rs3$03$1 at news.t-online.com...
    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.
    Example:
    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?

    Thanks
    Uwe
  • Tim Golden at Aug 29, 2003 at 8:52 am
    Uwe Becher <ubecher at gmx.net> wrote in message news:<bilh88$rs3$03$1 at news.t-online.com>...
    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.

    Example:
    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?

    Thanks
    Uwe
    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
    http://tgolden.sc.sabren.com/python/wmi.html 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>

    TJG
  • Uwe Becher at Aug 29, 2003 at 2:51 pm

    Tim Golden wrote:
    Uwe Becher <ubecher at gmx.net> wrote in message news:<bilh88$rs3$03$1 at news.t-online.com>...
    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.

    Example:
    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?

    Thanks
    Uwe

    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
    http://tgolden.sc.sabren.com/python/wmi.html 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>

    TJG
    Tim,

    that did the job, thanks!

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouppython-list @
categoriespython
postedAug 28, '03 at 6:22p
activeAug 29, '03 at 2:51p
posts5
users4
websitepython.org

People

Translate

site design / logo © 2022 Grokbase