To start with I’m using an old version RealBasic 2008 r4.2
My 32-bit app will be run on both 32-bit and 64-bit Windows systems. I’m trying to edit the registry to set the Powershell ExecutionPolicy and on 32-bit systems it works correctly, but on 64-bit systems the path it’s writing to is being redirected by the OS.
dim registry As RegistryItem
registry = New RegistryItem("HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\PowerShell\\1\\ShellIds\\Microsoft.PowerShell")
registry.Value("ExecutionPolicy") = "Unrestricted"
On 64-bit systems, Microsoft reroutes that path to:
I need to be able to write to both paths.
I had the same type of problem when writing files to the system32 directory. In that case I found that if I use sysnative instead of System32 in the path, I was able to write the files to the system32 directory instead of it being redirected to C:\Windows\SysWOW64. Is there a similar way to do this in the registry?