Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > NetServerDiskEnum in win32net

Reply
Thread Tools

NetServerDiskEnum in win32net

 
 
Uwe Becher
Guest
Posts: n/a
 
      08-28-2003
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

 
Reply With Quote
 
 
 
 
News M Claveau /Hamster-P
Guest
Posts: n/a
 
      08-28-2003
Hi !

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

--
Michel Claveau


 
Reply With Quote
 
 
 
 
Roger Upole
Guest
Posts: n/a
 
      08-29-2003
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" <(E-Mail Removed)> wrote in message
news:bilh88$rs3$03$(E-Mail Removed)-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
>



 
Reply With Quote
 
Tim Golden
Guest
Posts: n/a
 
      08-29-2003
Uwe Becher <(E-Mail Removed)> wrote in message news:<bilh88$rs3$03$(E-Mail Removed)-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
 
Reply With Quote
 
Uwe Becher
Guest
Posts: n/a
 
      08-29-2003
Tim Golden wrote:
> Uwe Becher <(E-Mail Removed)> wrote in message news:<bilh88$rs3$03$(E-Mail Removed)-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!

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem with win32net on Windows 2K Read Roberts Python 1 01-27-2005 09:29 PM
win32net help Shin Python 1 01-14-2005 10:22 PM
win32net.NetUserChange vs XP Robin Becker Python 0 12-01-2003 10:37 AM



Advertisments