NetServerDiskEnum in win32net

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Uwe Becher

    NetServerDiskEnum in win32net

    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:
    [color=blue][color=green][color=darkred]
    >>> win32net.NetSer verDiskEnum('no r1w020', 0) gives me:[/color][/color][/color]
    ([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

  • News M Claveau /Hamster-P

    #2
    Re: NetServerDiskEn um in win32net

    Hi !

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

    --
    Michel Claveau


    Comment

    • Roger Upole

      #3
      Re: NetServerDiskEn um in win32net

      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@gmx.ne t> wrote in message
      news:bilh88$rs3 $03$1@news.t-online.com...[color=blue]
      > 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[/color]
      drives.[color=blue]
      >
      > Example:
      >[color=green][color=darkred]
      > >>> win32net.NetSer verDiskEnum('no r1w020', 0) gives me:[/color][/color]
      > ([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
      >[/color]


      Comment

      • Tim Golden

        #4
        Re: NetServerDiskEn um in win32net

        Uwe Becher <ubecher@gmx.ne t> wrote in message news:<bilh88$rs 3$03$1@news.t-online.com>...[color=blue]
        > 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:
        >[color=green][color=darkred]
        > >>> win32net.NetSer verDiskEnum('no r1w020', 0) gives me:[/color][/color]
        > ([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[/color]

        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_Logical Disk (DriveType=3):
        print disk.Caption

        </code>

        TJG

        Comment

        • Uwe Becher

          #5
          Re: NetServerDiskEn um in win32net

          Tim Golden wrote:[color=blue]
          > Uwe Becher <ubecher@gmx.ne t> wrote in message news:<bilh88$rs 3$03$1@news.t-online.com>...
          >[color=green]
          >>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:
          >>[color=darkred]
          >> >>> win32net.NetSer verDiskEnum('no r1w020', 0) gives me:[/color]
          >>([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[/color]
          >
          >
          > 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_Logical Disk (DriveType=3):
          > print disk.Caption
          >
          > </code>
          >
          > TJG[/color]
          Tim,

          that did the job, thanks!

          Comment

          Working...