Hi there, 

I'm running into an unusual issue trying to create a batch script that determines if a workstation is 64bit or 32 bit, and chooses the appropriate dependency to execute. When I run the script, I get an msi error 1603. Looking in the msi install logs, the error says its trying to install the 32 bit msi on the 64 bit system. Logging in locally to this machine, when i run the same batch script, the logic works fine and it executes the correct installer. As a work around, i tried to put the script in a secondary batch script which i uploaded as a dependency, and executed that script as a sub-shell somewhat. Same issue.  Also worth noting, i have tried running the script as both "Logged in User" and "Local System". Same results both ways. 

Has anyone run into anything like this before?  

Here is the script below

@echo off
IF EXIST "C:\install.txt" (del C:\install.txt)

IF %PROCESSOR_ARCHITECTURE%==x86 (msiexec /i "install_x86.msi" /l*v "C:\install.txt"  /qn)
ELSE (msiexec /i "install_x64.msi" /l*v "C:\install.txt"  /qn)

0 Comments   [ + ] Show Comments


Please log in to comment

Community Chosen Answer

The Kace Agent is 32 bit software, so doing a processor arch check will not give you your expected results. Probably easiest to verify presence of Program Files (x86)...

IF EXIST "C:\Program Files (x86)" msiexec /i "install_x64.msi" /l*v "C:\install.txt"  /qn
IF NOT EXIST C:\Program Files (x86)" msiexec /i "install_x86.msi" /l*v "C:\install.txt"  /qn
Answered 03/24/2015 by: SDNBTP
Third Degree Blue Belt

Please log in to comment


        @echo off

        IF EXIST "C:\install.txt" (del C:\install.txt)

        reg Query "HKLM\Hardware\Description\System\CentralProcessor\0" | find /i "x32" > NUL && set OS=32BIT || set OS=64BIT

        if %OS%==32BIT (msiexec /i "install_x86.msi" /l*v "C:\install.txt"  /qn)
        if %OS%==64BIT (msiexec /i "install_x64.msi" /l*v "C:\install.txt"  /qn)
Answered 03/31/2015 by: rock_star
Black Belt

Please log in to comment
Answer this question or Comment on this question for clarity
Admin Script Editor
Admin Script Editor is an integrated scripting environment available free here at ITNinja