简体   繁体   English

确定64位与32位Windows

[英]Determining 64-bit vs. 32-bit Windows

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. 我想根据操作系统在构建过程中是64位还是32位来配置visual studio 2005来复制.dll。

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. 我的第一次尝试是使用批处理文件来查找Windows版本,但是某些32位和64位版本的Windows共享相同的版本号。

Anyone know of any way to check this? 有谁知道有任何方法来检查这个?

Thanks! 谢谢!

You should be able to read the environment variable %PROCESSOR_ARCHITECTURE%. 您应该能够读取环境变量%PROCESSOR_ARCHITECTURE%。 Here is some great information on it. 这里有一些很好的信息。

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

Check out isWow64 , I think that shopuld give you what you are after. 退房isWow64 ,我认为shopuld会给你你所追求的。

Determines whether the specified process is running under WOW64. 确定指定的进程是否在WOW64下运行。

Jon's link is a total hack because it relies upon no new processor architectures being added. Jon的链接完全是黑客,因为它依赖于没有添加新的处理器架构。

See: http://support.microsoft.com/kb/556009 for the "official" batch file method. 有关“官方”批处理文件方法,请参阅: http//support.microsoft.com/kb/556009

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM