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%>
Are you actually running a 64-bit version of Windows? If you are running 32-bit Windows on a 64-bit-capable CPU, you will still get x86.
x86