Forms Newbie

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 9 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.
Locked
User avatar
phurious
Posts: 15
Last visit: Tue Oct 15, 2019 12:06 pm

Re: Forms Newbie

Post by phurious »

jvierra wrote:You must specify which hive you are querying.

The key is clearly a main hive key. If you run it as a 64 bit script on a 64 bit machine it will work correctly. The same on a 32 bit machine.
jvierra, I understand this but my question remains. Because this script is going to be packaged as a 32Bit executable, how do I successfully extract registry keys on any x64 system the tool may be run on?
Last edited by phurious on Fri Jun 03, 2016 8:36 am, edited 1 time in total.
User avatar
phurious
Posts: 15
Last visit: Tue Oct 15, 2019 12:06 pm

Re: Forms Newbie

Post by phurious »

phurious wrote:
jvierra wrote:You must specify which hive you are querying.

The key is clearly a main hive key. If you run it as a 64 bit script on a 64 bit machine it will work correctly. The same on a 32 bit machine.
jvierra, I understand this but my question remains. Because this script is going to be packaged as a 32Bit executable, how do I successfully extract registry keys on any x64 system the tool may be run on?
Never mind. I found the /reg:64 switch which I previously was not aware existed. Thanks to jvierra and monoeagle's for their assistance!
jvierra
Posts: 15439
Last visit: Tue Nov 21, 2023 6:37 pm
Answers: 30
Has voted: 4 times
Been upvoted: 33 times

Re: Forms Newbie

Post by jvierra »

You will have to add code and ad the hive selector to the command line.
jvierra
Posts: 15439
Last visit: Tue Nov 21, 2023 6:37 pm
Answers: 30
Has voted: 4 times
Been upvoted: 33 times

Re: Forms Newbie

Post by jvierra »

Her is how to detect that:

if([environment]::Is64BitOperatingSystem){ <#add /reg:64 #> }
User avatar
phurious
Posts: 15
Last visit: Tue Oct 15, 2019 12:06 pm

Re: Forms Newbie

Post by phurious »

jvierra wrote:Her is how to detect that:

if([environment]::Is64BitOperatingSystem){ <#add /reg:64 #> }
jvierra, I had added the below code:
  1. If([environment]::Is64BitOperatingSystem){$argument += "/reg:64"}
I am certain your code does the same thing or something very similar but I am unfamiliar with the last bit:
  1. <#add /reg:64 #>
This is appending the required switch, but how?
Last edited by phurious on Fri Jun 03, 2016 9:16 am, edited 1 time in total.
jvierra
Posts: 15439
Last visit: Tue Nov 21, 2023 6:37 pm
Answers: 30
Has voted: 4 times
Been upvoted: 33 times

Re: Forms Newbie

Post by jvierra »

It is an embedded comment.
User avatar
monoeagle
Posts: 108
Last visit: Fri Jan 26, 2024 10:44 am

Re: Forms Newbie

Post by monoeagle »

phurious wrote:Thanks to jvierra and monoeagle's for their assistance!
you're welcome
This topic is 7 years and 9 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.
Locked