Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>The <code>PROCESSOR_ARCHITECTURE</code> environment variable contains the address width of the running process, which is not necessarily that of the operating system or processors. A quick way to see this is by running the following command...</p> <pre><code>$Env:PROCESSOR_ARCHITECTURE </code></pre> <p>...in 32- and 64-bit PowerShell sessions and comparing the output.</p> <p>So, if <code>GetEnvironmentVariable("PROCESSOR_ARCHITECTURE")</code> returns <code>"AMD64"</code> then you definitely have a 64-bit process, operating systems, and processors. If it returns <code>"x86"</code> then you definitely have a 32-bit process, though you still won't know if the operating system and processors are 32- or 64-bit.</p> <p>If you're really after the address width of the operating system, then .NET 4 offers the <a href="http://msdn.microsoft.com/en-us/library/system.environment.is64bitoperatingsystem.aspx" rel="nofollow" title="Environment.Is64BitOperatingSystem Property on MSDN">Environment.Is64BitOperatingSystem property</a>. You can also use WMI on any version of .NET to read the <code>OSArchitecture</code> property of the <a href="http://msdn.microsoft.com/library/aa394239.aspx" rel="nofollow" title="Win32_OperatingSystem Class on MSDN">Win32_OperatingSystem class</a>:</p> <pre><code>static string GetOSArchitecture() { var query = new WqlObjectQuery("SELECT OSArchitecture FROM Win32_OperatingSystem"); using (var searcher = new ManagementObjectSearcher(query)) using (var results = searcher.Get()) using (var enumerator = results.GetEnumerator()) { enumerator.MoveNext(); return (string) enumerator.Current.GetPropertyValue("OSArchitecture"); } } </code></pre> <p>...though, unfortunately, the <code>OSArchitecture</code> property only exists on Windows Vista/Server 2008 and above.</p> <p>For all versions of Windows since 2000, you might try p/invoking the <a href="http://msdn.microsoft.com/library/ms724381.aspx" rel="nofollow" title="GetSystemInfo function on MSDN">GetSystemInfo() function</a> and checking the <code>wProcessorArchitecture</code> member of the <a href="http://msdn.microsoft.com/library/ms724958.aspx" rel="nofollow" title="SYSTEM_INFO structure on MSDN">SYSTEM_INFO structure</a>.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload