Click here to Skip to main content
12,764,666 members (39,218 online)
Click here to Skip to main content
Alternatives (5)
Add your own
alternative version

Stats

58.1K views
18 bookmarked
Posted 6 Sep 2010

32-Bit or 64-bit OS ??

, 21 Sep 2010 CPOL
A simple way to detect bitness of an OS Programatically. (C# and C++ examples given)

Alternatives

Members may post updates or alternatives to this current article in order to show different approaches or add new features.

13 Oct 2010
Reinhard Ostermeier
In .NET 4.0, you can also use the new System.Environment.Is64BitOperatingSystem and System.Environment.Is64BitProcess
19 Sep 2010
Aescleal
In C++ you can use the size of a pointer to work out what sort of process you're running in:bool is_64_bit(){ return sizeof(void *) == 8;}This has got the advantage of being portable and you don't have to call any OS functions.You can do something similar in C - just return...
20 Sep 2010
a_pess
To check 64Bit Operating system in VB.NET,Public Shared Function is64BitOPeratinSystem() As Boolean Return (Marshal.SizeOf(IntPtr.Zero) = 8)End Function
5 Aug 2011
The_Mega_ZZTer
Version check is wrong. It happens to work correctly only because no minor versions of Windows 5 were released after 5.1 (AFAIK... are Windows Server 2003 and Embedded XP and Media Center XP still 5.1?). A theoretical version 5.2 would fail the check. I submit the following...

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

Share

About the Author

http://gputoaster.wordpress.com/about

| | Privacy | Terms of Use | Mobile
Web01 | 2.8.170217.1 | Last Updated 21 Sep 2010
Article Copyright 2010 by GPUToaster™
Everything else Copyright © CodeProject, 1999-2017
Layout: fixed | fluid