Ask questions about creating Graphical User Interfaces (GUI) in PowerShell and using WinForms controls.
Forum rules Do not post any licensing information in this forum.
Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
This topic is 7 years and 10 months old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.
You can clearly see in the screencap the code is reporting that the key does not exist, but the window overlaying the Powershell Studio window is the registry editor opened to the exact key in question.
This also helps further illustrate my original question. When the code is "Run" from within Powershell Studio, the script reports the key is not found:
But if the exact same code on the same machine is "Run in Console" from within Powershell Studio, the script finds the key:
The credentials are the same, so why does running the script by clicking "Run" or packaging it into an EXE fail?
monoeagle wrote:Possibly a problem with the plattform? =)
Your Key is from the x64 Hive, your Script on the first picture is running under v4 x86 plattform.
On your second screen the console is running as x64.
Check your Configuration.
Couldn't see the forest for the trees . . . this is indeed the issue. Thank you Monoeagle!
Next question, this code has to run on both x86 and x64 systems so I am packaging it as 32 bit. How can I successfully export the registry keys on both x64 and x86? I already have a function to determine bitness built into the script but I am unfamiliar with having to address bitness dealing with the registry.
Last edited by phurious on Fri Jun 03, 2016 8:37 am, edited 1 time in total.
This topic is 7 years and 10 months old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.