Detect whether current Windows version is 32 bit or 64 bit

前端 未结 23 2741
抹茶落季
抹茶落季 2020-11-28 03:47

Believe it or not, my installer is so old that it doesn\'t have an option to detect the 64-bit version of Windows.

Is there a Windows DLL call or (even better) an en

23条回答
  •  南方客
    南方客 (楼主)
    2020-11-28 04:20

    I tested the following batch file on Windows 7 x64/x86 and Windows XP x86 and it's fine, but I haven't tried Windows XP x64 yet, but this will probably work:

    If Defined ProgramW6432 (Do x64 stuff or end if you are aiming for x86) else (Do x86 stuff or end if you are aiming for x64) 
    

提交回复
热议问题