I have a batch file that (for compatibility reasons) runs in a 32-bit cmd.exe
process. However, I now need to launch the 64-bit version of a Windows command-line tool, in this case msiexec
. How can I do this?
Additional detail:
I am using a batch file to install various software products. For maximum compatibility with older products, the batch file is running as a 32-bit process. However, I now need to install Intel Haxm, which requires the 64-bit version of msiexec
.
I tried already to call c:\windows\system32\msiexec.exe
, but when doing this the Windows installer log file still says:
=== Verbose logging started: 14.04.2015 14:27:53 Build type: SHIP UNICODE 5.00.9600.00 Calling process: c:\windows\SysWOW64\msiexec.exe ===
You can do this using the sysnative
alias, as described in the MSDN article File System Redirector:
32-bit applications can access the native system directory by substituting %windir%\Sysnative for %windir%\System32. WOW64 recognizes Sysnative as a special alias used to indicate that the file system should not redirect the access. This mechanism is flexible and easy to use, therefore, it is the recommended mechanism to bypass file system redirection. Note that 64-bit applications cannot use the Sysnative alias as it is a virtual directory not a real one.
Windows Server 2003 and Windows XP: The Sysnative alias was added starting with Windows Vista.
So, in a batch file, you would say something like
%windir%\sysnative\msiexec /install product.msi /passive /norestart
Or if you need to run another batch file
%windir%\sysnative\cmd.exe /c silent_install.bat
Note that sysnative
is not supported in the 64-bit versions of Windows XP or Windows 2003 unless hotfix 942589 has been installed. See this answer for one workaround.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With