Description Field in WinXP Services

rbt rbt at
Sat Jan 29 21:03:49 EST 2005

rbt wrote:
> Roger Upole wrote:
>> ChangeServiceConfig2 is the api functions that sets the description,
>> but it's not in the win32service module (yet).
>>          Roger
> OK, I can use _winreg to add the 'Description' field under the 
> appropriate registry key.

Here's an example of it... kludgey but it works ;)

from _winreg import *
import time

def Svc_Description():
         key_location = r"SYSTEM\CurrentControlSet\Services\test_py_service"
         svc_key = OpenKey(HKEY_LOCAL_MACHINE, key_location, 0, KEY_ALL_ACCESS)
         SetValueEx(svc_key,'Description',0,REG_SZ,u"Brad's Test Python Service")
     except Exception, e:
         print e


More information about the Python-list mailing list