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

  • SEARCH
  • Home
  • 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 35283
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 10, 20262026-05-10T14:12:42+00:00 2026-05-10T14:12:42+00:00

Since the WMI class Win32_OperatingSystem only includes OSArchitecture in Windows Vista, I quickly wrote

  • 0

Since the WMI class Win32_OperatingSystem only includes OSArchitecture in Windows Vista, I quickly wrote up a method using the registry to try and determine whether or not the current system is a 32 or 64bit system.

private Boolean is64BitOperatingSystem() {     RegistryKey localEnvironment = Registry.LocalMachine.OpenSubKey('SYSTEM\\CurrentControlSet\\Control\\Session Manager\\Environment');     String processorArchitecture = (String) localEnvironment.GetValue('PROCESSOR_ARCHITECTURE');      if (processorArchitecture.Equals('x86')) {         return false;     }     else {         return true;     } } 

It’s worked out pretty well for us so far, but I’m not sure how much I like looking through the registry. Is this a pretty standard practice or is there a better method?

Edit: Wow, that code looks a lot prettier in the preview. I’ll consider linking to a pastebin or something, next time.

  • 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-10T14:12:43+00:00Added an answer on May 10, 2026 at 2:12 pm

    Take a look at Raymond Chens solution:

    How to detect programmatically whether you are running on 64-bit Windows

    and here’s the PINVOKE for .NET:

    IsWow64Process (kernel32)

    Update: I’d take issue with checking for ‘x86’. Who’s to say what intel’s or AMD’s next 32 bit processor may be designated as. The probability is low but it is a risk. You should ask the OS to determine this via the correct API’s, not by querying what could be a OS version/platform specific value that may be considered opaque to the outside world. Ask yourself the questions, 1 – is the registry entry concerned properly documented by MS, 2 – If it is do they provide a definitive list of possible values that is guaranteed to permit you as a developer to make the informed decision between whether you are running 32 bit or 64 bit. If the answer is no, then call the API’s, yeah it’s a but more long winded but it is documented and definitive.

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

Sidebar

Related Questions

Using Windows' WMI library, how can I eject CD rom mounted in a specific
Since it's impossible to capture text from a java canvas by using standard Windows
Since the only operations required for a container to be used in a stack
Since the getElementsByTagName() function is new (DOM-1?) I wanted another more reliable method to
Since yesterday I haven't been able to generate strong name keys using sn.exe or
Since I started using Fireworks CS5.1, and it doesn't matter how I write the
Since I'm using Java 1.4.2, this means that I cannot use Java's implementation of
I've been creating a an application with C# using W2k8+IIS7/SQLExpress 2008/Web Service/Windows Client. I'll
Since I am new to using Unity 2.0, I need some pointer or suggestion
Since static fields objects are created at class level(and common to all objects), Is

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.