I am trying to retrieve the environment variable to detect whether the system is 32 or 64 bit.
But on 64 bit server the environment variable %processor_architecture%>
I think part of the reason it is like this way is that the x86-64 architecture has to allow 32-bit programs to treat it as identical (as far as possible) to a 32-bit environment and make sure that 32-bit programs do not think it is 64-bit only (like the Itanium architecture).
This however makes it very frustrating to people who need to access the differences between the x86-64 architecture vs 32 bit architecture on Windows.