Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

i want to make cmd file witch would take this command systeminfo | findstr /I type: and then save windows type (for ex. 32 bit). Then i want with IF help install winrar. For ex.: if windows are 32bit, i want that winrar would install 32 bit, if windows are 64bit - winrar 64 bit. How to do so ?

share|improve this question
up vote 1 down vote accepted

You can also use the PROCESSOR_ARCHITECTURE environment variable.

if "%PROCESSOR_ARCHITECTURE%" EQU "x86" (
   echo Do 32-bit installation here.
) else (
   echo Do 64-bit installation here.
)
share|improve this answer
set /a "x64=1<<32>>32"
if %x64% == 0 echo 32 bit
if %x64% == 1 echo 64 bit

Have not really tested this on 64 bit system. Confirmation welcomed.

share|improve this answer

Ask for an input, 64 or 32 if unknown 32.

@echo off
echo.
echo 64
echo 32
echo IDK
echo.
set /p bit=
goto bit
else
exit
goto %bit%
:32
:IDK
start winrar32.exe
goto done
:64
start winrar64
goto done
:done
cls
echo. Installer Is running...
pause
share|improve this answer
1  
Also If you had done any research you would have found the above code. – Jacob Eggebeen Jul 14 '13 at 13:51

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .