Wednesday, June 22, 2016

Detect 64- and 32-bit Windows in a batch file

@echo off

set bitness=64
if /I %PROCESSOR_ARCHITECTURE% == x86 (
    if not defined PROCESSOR_ARCHITEW6432 (
        set bitness=32
    )
)

echo Operating System is %bitness% bit

if %bitness% == 32 (
    echo Operating System is 32 bit
) else (
    echo Operating System is 64 bit
)

No comments:

Post a Comment