11.15.2013

Batch File to Detect OS Arch 32bit or 64bit

Batch File to Detect OS Arch 32bit or 64bit

@echo off
cls
if /i %processor_architecture%==AMD64 GOTO AMD64
if /i %PROCESSOR_ARCHITEW6432%==AMD64 GOTO AMD64
if /i %processor_architecture%==x86 GOTO x86
:AMD64
echo OS is 64bit
rem do amd64 stuff
GOTO EXEC
:x86
echo OS is 32bit
GOTO EXEC
:EXEC
rem do arch independent stuff
GOTO END
:ERR
@echo Unsupported architecture!
pause
:END
pause

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.