how I get if windows is x64 or 32 bit to set a condition
how I get if windows is x64 or 32 bit
My purpose is set a condition for a component to install depending if 32 or 64
Answers (6)
Top Answer
I think you're after this script:
@echo off
if %PROCESSOR_ARCHITECTURE% == x86 (
goto :x86
) else (
goto :x64
)
:x86
REM put here x86 application to execute like this example FOO.EXE executabe
start "foo.exe"
goto :eof
:x64
REM put here x86 application to execute like this example BAR.EXE executabe
start "bar.exe"
goto :eof
REM put here some common code for both architectures
:EOF
Kind regards,
StockTrader
Here is how we do it.
I create a folder and dump both the x64 and x32 msi files in it. I then create a batch file that looks like this
@echo off
IF %Processor_Architecture% == x86 goto x86
goto x64
:x86
start /wait msiexec.exe /i install_flash_player_11_active_x_32bit.msi /qr
goto done
:x64
start /wait msiexec.exe /i install_flash_player_11_active_x_64bit.msi /qr
goto done
:done
echo "script complete"
I then take all 3 put it in a zip file and then create a new software inventory item and upload this is a package. Then using a script I just deploy this software package and tell it to execute the bat file I created.