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.
User avatar
phurious
Posts: 15
Meble kuchenne na zamówienie - na wymiar - Wrocław
Joined: Sun Mar 03, 2013 12:42 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
Joined: Sun Mar 03, 2013 12:42 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: 14445
Joined: Tue May 22, 2007 9:57 am
Contact:

Re: Forms Newbie

Post by jvierra »

You will have to add code and ad the hive selector to the command line.

jvierra
Posts: 14445
Joined: Tue May 22, 2007 9:57 am
Contact:

Re: Forms Newbie

Post by jvierra »

Her is how to detect that:

if([environment]::Is64BitOperatingSystem){ <#add /reg:64 #> }

User avatar
phurious
Posts: 15
Joined: Sun Mar 03, 2013 12:42 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: 14445
Joined: Tue May 22, 2007 9:57 am
Contact:

Re: Forms Newbie

Post by jvierra »

It is an embedded comment.

User avatar
monoeagle
Posts: 108
Joined: Tue Oct 13, 2015 9:10 am

Re: Forms Newbie

Post by monoeagle »

phurious wrote:Thanks to jvierra and monoeagle's for their assistance!
you're welcome

Locked