NetServerDiskEnum in win32net

Discussion in 'Python' started by Uwe Becher, Aug 28, 2003.

  1. Uwe Becher

    Uwe Becher Guest

    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
     
    Uwe Becher, Aug 28, 2003
    #1
    1. Advertising

  2. Hi !

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

    --
    Michel Claveau
     
    News M Claveau /Hamster-P, Aug 28, 2003
    #2
    1. Advertising

  3. Uwe Becher

    Roger Upole Guest

    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" <> wrote in message
    news:bilh88$rs3$03$-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
    >
     
    Roger Upole, Aug 29, 2003
    #3
  4. Uwe Becher

    Tim Golden Guest

    Uwe Becher <> wrote in message news:<bilh88$rs3$03$-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 Golden, Aug 29, 2003
    #4
  5. Uwe Becher

    Uwe Becher Guest

    Tim Golden wrote:
    > Uwe Becher <> wrote in message news:<bilh88$rs3$03$-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!
     
    Uwe Becher, Aug 29, 2003
    #5
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Robin Becker

    win32net.NetUserChange vs XP

    Robin Becker, Dec 1, 2003, in forum: Python
    Replies:
    0
    Views:
    344
    Robin Becker
    Dec 1, 2003
  2. Shin

    win32net help

    Shin, Jan 13, 2005, in forum: Python
    Replies:
    1
    Views:
    423
  3. Read Roberts

    Problem with win32net on Windows 2K

    Read Roberts, Jan 27, 2005, in forum: Python
    Replies:
    1
    Views:
    448
    Kartic
    Jan 27, 2005
Loading...

Share This Page