[python-win32] wmi and NT service

Tim Golden tim.golden at viacom-outdoor.co.uk
Mon Nov 22 17:36:11 CET 2004


[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 >>>

TJG

________________________________________________________________________
This e-mail has been scanned for all viruses by Star. The
service is powered by MessageLabs. For more information on a proactive
anti-virus service working around the clock, around the globe, visit:
http://www.star.net.uk
________________________________________________________________________


More information about the Python-win32 mailing list