[python-win32] wmi and NT service
Steve Holden
steve at holdenweb.com
Mon Nov 22 17:56:06 CET 2004
Tim Golden wrote:
> [walou]
> | It was just a ms-joke, because the service is launched by SYSTEM
> | account, so the service tried to import %WINDIR%\Sytem32\wmi.dll ....
> | renaming wmi.py to pywmi.py solved the problem
>
> Well done for spotting that. It's come up a number of times
> on this list before (and the main Python one). I really should
> put a warning on the WMI page, but I keep forgetting.
>
> | How can I get the name of the currently logged on user in a
> | NT service ?
>
> 1 >>> import win32api
> 2 >>> win32api.GetUserName ()
> 2 --> 'goldent'
> 3 >>>
>
Given that there is a wmi.dll, might it not be better to give in and
rename your package to pywmi?
pragmatical-ly y'rs - steve
--
http://www.holdenweb.com
http://pydish.holdenweb.com
Holden Web LLC +1 800 494 3119
More information about the Python-win32
mailing list