[python-win32] Python Service does not start at Windows boot but at user's logon

Tim Roberts timr at probo.com
Wed Jun 11 18:59:34 CEST 2008


spoirot wrote:
>>   
> I totally agree with you. I have found another dependency to use : 
> Themes, which is less heavy than RPCSS.
> This works, but it does not make exactly what I want.

Plus, it is simply not an acceptable practice for you to change some 
other service's dependencies.


> Indeed, I would like to set some values in a HKLM subkey
> at windows boot, in order that changes are effective as soon as a user 
> logs in after boot sequence.

Why?  What are you really trying to do here?  What you're describing 
sounds like a perfect vector for malware and trojan horses.

You can certainly have a domain login script that gets executed very 
early in the login sequence.  That's how most corporate environments 
enforce their IT policies.


> In my case,
> registry values are well written, but changes aren't effective yet... 
> So user needs to reboot.
> I tried to use the FlushKey() method from _winreg module in order to 
> immediately write changes to registry.
> Changes are written, but not effective. I thought that user's login 
> refreshed the registry, and then changes could
> have taken effect, but it seems not to be really the case.

Which registry entries are you changing?  Perhaps there is another way.


> Is there any other Python _winreg method that could force registry 
> changes to become effective as soon as
> changes are written into the registry ?

This is just not the right question.  Any changes take effect 
immediately, but if some other process has already read the value, 
there's nothing you can do, unless there's a way to notify the other 
process to re-read its settings.

-- 
Tim Roberts, timr at probo.com
Providenza & Boekelheide, Inc.



More information about the python-win32 mailing list