Notice: This forum has been recovered from an old backup, so some content, links, and dates may be outdated. The forum is currently read-only while we restore sign-in and registration functionality. Details
If you find this forum valuable and would like to help keep it online, donations to help cover hosting and domain costs are greatly appreciated, but never expected. You can support the forum through Buy Me a Coffee or Ko-fi. Thank you for helping preserve the EventGhost community.
If you find this forum valuable and would like to help keep it online, donations to help cover hosting and domain costs are greatly appreciated, but never expected. You can support the forum through Buy Me a Coffee or Ko-fi. Thank you for helping preserve the EventGhost community.
How do I set and get a registry value from a variable?
How do I set and get a registry value from a variable?
I tried to google on the site, but I couldn't find the answer to this. I need to know the right python code to set and get registry values (I want to use the registry to keep values that are consistent after a reboot and can be shared between Girder and EG). I'm sure it's pretty simple once you know it, I just couldn't find it in the documentation or on the site.
- Pako
- Plugin Developer
- Posts: 2294
- Joined: Sat Nov 11, 2006 1:31 pm
- Location: Czech Republic
- Contact:
Re: How do I set and get a registry value from a variable?
These actions are unsatisfactory for you?
Pako
Pako
Re: How do I set and get a registry value from a variable?
Thanks for answering! It's not that. It's that I need something that I can put in an "if then" script with tons of variables. I would have to create a gazillion single actions to do all that I want to do with thes. 
Re: How do I set and get a registry value from a variable?
I would think you could use the built-in command as Pako suggests, then right-click on the action created and select "Copy as Python". That will give you the syntax which you can use in a python script and substitute variables.
- Pako
- Plugin Developer
- Posts: 2294
- Joined: Sat Nov 11, 2006 1:31 pm
- Location: Czech Republic
- Contact:
Re: How do I set and get a registry value from a variable?
That's what I had in mind.kkl wrote:I would think you could use the built-in command as Pako suggests, then right-click on the action created and select "Copy as Python". That will give you the syntax which you can use in a python script and substitute variables.
Pako
Re: How do I set and get a registry value from a variable?
Wow, thanks! I had no idea that was possible!
This is the code I get:
Is it possible to convert the number that ends with an L to what it actually should be, which is HKEY_CURRENT_USER? This did not work:
Code: Select all
eg.plugins.System.RegistryChange(2147483649L, u'Software\\Automatisering\\Styring av ovner\\Hjornesoverom', u'Aktivert', 0, None, u'0')Code: Select all
eg.plugins.System.RegistryChange(u'HKEY_CURRENT_USER', u'Software\\Automatisering\\Styring av ovner\\Hjornesoverom', u'Aktivert', 0, None, u'0')Re: How do I set and get a registry value from a variable?
Why do you want/need to do this?Mastiff wrote:Is it possible to convert the number that ends with an L to what it actually should be, which is HKEY_CURRENT_USER? This did not work:
I guess you could do like this:
Code: Select all
HKEY_CURRENT_USER = 2147483649Ljonib
Re: How do I set and get a registry value from a variable?
Right, of course! I could do that as a variable in a startup action! Thanks! The reason I want to do that is that I will have a whole lot of these things in my scripts, and I want to be able to see what part of the registry they are saved to.
