RegistryKey not written


I want to write a value to the registry so my program starts at Windows startup.
I have this simple code:

Dim reg As New RegistryItem("HKEY_LOCAL_MACHINE\\Software\\Microsoft\\Windows\\CurrentVersion\\Run") reg.Value("test") = "c:\\test.exe"

But, the value isn’t in the Registry, do I need to do something else to write it?


Edit: I run the program as administrator, I’m not getting any error messages too.

If you’re running a 32 bit app on a 64 bit version of Windows, then this registry path is transparently redirected to HKEY_LOCAL_MACHINE\\Software\\Wow6432Node\\Microsoft\\Windows\\CurrentVersion\\Run.

MBS Plugin has registry class with switch for 32bit apps to work on 64Bit registry instead.


There’s no obvious reason to bypass registry redirection in this case.