How do I tell if my application (compiled in Visual Studio 2008 as Any CPU) is running as a 32-bit or 64-bit application?
The easiest way, without installing another program or running the file, is just to right click on the file, choose Properties, and then go the the Compatibility tab. If there are no greyed out options and Windows XP and 9x modes are offered, it's 32-bit.
Can I run 32-bit programs on a 64-bit computer? Most programs made for the 32-bit version of Windows will work on the 64-bit version of Windows except for most Antivirus programs. Device drivers that are made for the 32-bit version of Windows will not work correctly on a computer running a 64-bit version of Windows.
If you're using .NET 4.0, it's a one-liner for the current process:
Environment.Is64BitProcess
Reference: Environment.Is64BitProcess Property (MSDN)
if (IntPtr.Size == 8)
{
// 64 bit machine
}
else if (IntPtr.Size == 4)
{
// 32 bit machine
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With