Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 158759
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T10:44:18+00:00 2026-05-11T10:44:18+00:00

If you launch a 32-bit instance of Powershell (%SystemRoot%\syswow64\WindowsPowerShell\v1.0\powershell.exe), then the registry provider only

  • 0

If you launch a 32-bit instance of Powershell (%SystemRoot%\syswow64\WindowsPowerShell\v1.0\powershell.exe), then the registry provider only sees the limited 32-bit parts of the registry.

**32-bit console** PS> (dir HKLM:\SOFTWARE | measure).count - (dir HKLM:\SOFTWARE\wow6432node | measure).count  0  **64-bit console** PS> (dir HKLM:\SOFTWARE | measure).count - (dir HKLM:\SOFTWARE\wow6432node | measure).count  -5 

Is there any way to force the provider into 64-bit mode? I could drop down to [Microsoft.Win32] .Net APIs, or maybe WMI, but I’d rather not. I’m using Powershell v2 CTP3 if that expands the possibilities at all.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-11T10:44:19+00:00Added an answer on May 11, 2026 at 10:44 am

    When Powershell is running as a 32 bit process, I am not aware of a mechanism to ‘switch it’ to 64bit mode. The whole point of virtualization support in 64bit systems is to make 32bit processes believe they are living in a 32bit OS…

    However, that said I used the following technique in the past and it worked very nicely for me (the following code was tested on Vista SP1 x64 with Powershell v1). The technique relies on the fact that .NET’s ‘Any CPU’ executables will run as 64bit process even when invoked from a 32bit process. The steps we will be performing:

    1. Compile a short C# program that will start powershell (i.e. a very simple ‘fork’ implementation 🙂 )
    2. Run the compiled C# program
    3. The compiled C# program will start Powershell, but because it’s ‘Any CPU’, it will be running as a 64bit process so it will start 64bit Powershell (note that because this is just a proof-of-concept, I expect powershell to be in your ‘path’)
    4. The new 64bit Powershell will run a commandlet of our choice

    This is a screenshot of the above in action (notice bit-ness of the processes): Process tree http://img3.imageshack.us/img3/3248/powershellfork.png

    The following program expects all the files listed to reside in the same directory. I recommend creating a test directory, e.g. C:\Temp\PowershellTest, and storing all the files there).

    Entry point to the program will be a simple commandlet:

    # file 'test.ps1' $basePath = Split-Path -resolve $myInvocation.MyCommand.Path $exe = Join-Path $basePath test.exe &'$env:SystemRoot\Microsoft.NET\Framework\v3.5\csc.exe' /nologo /target:exe /out:$exe (Join-Path $basePath test.cs) &$exe (Join-Path $basePath visibility.ps1) 

    It runs csc (32bit, but it doesn’t matter 🙂 ) and then runs result of csc compiler, passing one argument, (full path to) visibility.ps1 (this is the commandlet we want to run in 64bit Powershell).

    The C# code is very simple as well:

    // file 'test.cs' using System.Diagnostics; static class Program {     static int Main(string[] args) {         ProcessStartInfo i = new ProcessStartInfo('powershell', args[0]);         i.UseShellExecute = false;         using(Process p = Process.Start(i)) {             p.WaitForExit();             return p.ExitCode;         }     } } 

    And finally, your ‘visibility’ script:

    # file 'visibility.ps1' (dir HKLM:\SOFTWARE).count - (dir HKLM:\SOFTWARE\wow6432node).count 

    Running the entry script from 32bit Powershell now yields desired result (just to show I was not cheating I run the visibility script directly first, then using our fork technique):

    Program run http://img3.imageshack.us/img3/2766/powershellrunc.png

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 266k
  • Answers 266k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer The problem is entirely caused by the Tables.Clear() line in… May 13, 2026 at 12:40 pm
  • Editorial Team
    Editorial Team added an answer Perhaps the "@" is a glob character in zsh, expanding… May 13, 2026 at 12:40 pm
  • Editorial Team
    Editorial Team added an answer Figured it out. return (List<Transaction>)currentSession .CreateCriteria(typeof(Transaction)) .CreateCriteria("GLAllocations", JoinType.LeftOuterJoin) .Add(Restrictions.IsNull("GL")) .List<Transaction>(); May 13, 2026 at 12:40 pm

Related Questions

Say you have an app, that you want to provide users ability to browse
Consider the following dialog with the command-line interface to the kernel: $ math Mathematica
I would like to keep the overhead at a minimum. Right now I have:
Our application takes significantly more time to launch after a reboot (cold start) than

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.