This little batch file scriptlet will allow you to run a command based on architecture:

set ProgFiles86Root=%ProgramFiles(x86)%

IF NOT "%ProgFiles86Root%"=="" (
vcredist_x64.exe /q /norestart
) ELSE (
vcredist_x86.exe /q /norestart

As you can see replacing the vcredist_x64.exe /q /norestart with another command specific to 64 bit will run if it finds a Program Files (x86). Else, it runs the next command that would be 32bit.

There may be a more elegant way of doing it, but here ya go anyway. Plop this in a batch file and set it as an MI and you are able to have only one MI for both architectures.
0 Comments   [ - ] Hide Comments


Please log in to comment

Community Chosen Answer


Interesting. I've used

IF EXIST "C:\Windows\SysWOW64" (
run something for x64
) ELSE (
run something for x86

Answered 10/05/2011 by: cmccracken
Orange Senior Belt

Please log in to comment
Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.
Answer this question or Comment on this question for clarity


Batch files are scripts run by cmd.exe. But which cmd.exe: the one in %SystemRoot%\system32, the one in %SystemRoot%\SysWOW64, or the one in %SystemRoot%\sysnative? It does matter! Windows tries very hard to hide the 64-bit environment when you run a 32-bit executable.

I was totally baffled by these differences until I attended this one day online class:

Need some convincing? I found these two blogs useful:
http://csi-windows.com/toolkit/csi-getosbits and

I highly recommend Darwin's insights. Sande
Answered 10/05/2011 by: snissen
Fourth Degree Green Belt

Please log in to comment