Determining 64-bit vs. 32-bit Windows

感情迁移 提交于 2019-11-29 13:26:12

问题


I'd like to configure visual studio 2005 to copy .dll's based on whether the OS is 64-bit or 32-bit during a build.

I do not want to specify what the platform target is.

My first attempt was to use a batch file to lookup the Windows version, but some 32-bit and 64-bit versions of Windows share the same version number.

Anyone know of any way to check this?

Thanks!


回答1:


You should be able to read the environment variable %PROCESSOR_ARCHITECTURE%. Here is some great information on it.

http://blogs.msdn.com/david.wang/archive/2006/03/26/HOWTO-Detect-Process-Bitness.aspx




回答2:


Check out isWow64, I think that shopuld give you what you are after.

Determines whether the specified process is running under WOW64.




回答3:


Jon's link is a total hack because it relies upon no new processor architectures being added.

See: http://support.microsoft.com/kb/556009 for the "official" batch file method.



来源:https://stackoverflow.com/questions/191873/determining-64-bit-vs-32-bit-windows

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!