Detect XP64 bit on DOS batch file

I have a DOS batch file.  I have also an executable for version 32bit and one for version 64bit.  I need to detect
on the batch file if the system running is an XP 64bit or an XP 32bit to pick up the correct executable to run.

I have seen some examples using systeminfo, it has the "OS Name" and the "SystemType".
My concern is what happens if Microsoft chosses a different name for the OS Name an does not include
the 64 number on that name? What if SystemType also is modified in the future and does not have the 64 number on it?
Are this two properties reliable?

Is there another global variable that we could check in a DOS batch file, or something else more reliable?

Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

You could look at the environment variables:


You could also use the systeminfo output.

This information could be parsed, just need to know if there is a consistent identifying feature for 64bit OS.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft DOS

From novice to tech pro — start learning today.