Daniel wrote:
Hello,

I'm trying to determine the amount of free hard disk space on a remote
windows host.  Seems like this should be simple, but it's giving me
grief.  Here's what I've tried:

mystat = os.stat('//remotehost/share/')
mystat
(16895, 0L, 0, 0, 0, 0, 0L, 1251731920, 1251731289, 1249399952)

Assuming you have the necessary security levels,
WMI's quite good at this kind of thing. See this
example:

 http://timgolden.me.uk/python/wmi_cookbook.html#percentage_free

and just add "remotehost" as the first parameter to the
wmi.WMI () call. (And I recommend find_classes=False) for
speed.

TJG
--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to