Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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
3  
what have you tried already? –  gronostaj Jul 14 '13 at 11:34
add comment

3 Answers

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
add comment
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
add comment

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
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.