Detect if project is running in 32 or 64 bit environment?

Other than just looking for a directory that normally only exists in x64 (like "C:\Program Files (x86)\"), does anyone use a reliable, elegant method to detect whether the current OS is x64 or x86?

We have developers working in a mixed O/S environment and I'm trying to find a reasonable way for them to run the same project scripts. So far, I've used kludges to do it, but this is ruffling my perfectionist feathers.

What about the PROCESSOR_ARCHITECTURE environment variable? On 64bit it is AMD64, not sure what is is on 32, probably something like x86 (don’t have a 32bit machine at home to check).

Thanks, Vincent, good idea. On 32-bit it’s “x86”. All I need to do is check to see if that is true.