[python-win32] Question: Finding the "owner" Of A Process

Bend bendra at gmail.com
Thu Aug 31 23:43:07 CEST 2006


Hi John I had the same problem recently except I'm using windows XP home
but it should work the same.

The trick is that you cannot access the method directly by calling it as for
some reason process.GetOwner is an integer 0 (perhaps the return code
of the method or something). What you have to do is use the execMethod_
function.

so your code would look something like this:

for proc in procs:
        result = proc.execMethod_('GetOwner')
        print "%s's owner is %s" % (proc.Name, result.User)

And similar replacements with the other calls to GetOwner.
execMethod_ returns an object with two feilds User and domain.

Hope this is what you were looking for
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.python.org/pipermail/python-win32/attachments/20060901/8002f34e/attachment.html 


More information about the Python-win32 mailing list