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%>
%processor_architecture%>
AMD64 is a brand of CPU which is based on the x86 architecture. x86-64 more precisely, which is the 64-bit extension of x86.
This also relates to bobince's answer.
This Knowledge Base article shows you how to determine if your system is 32-bit or 64-bit