There are a number of ways to launch Windows Installer setup (MSI) and from a batch file is a common one- here are a few combinations you may try when launching MSI installations from the command line:

The MSI command lines shown install the software silently with only a progress bar displayed (no prompts), it creates a log file for the installation in the temp directory and installs the software for use by all users (not just the current user).

  • The installation is carried out and the command window is closed when complete:

%Comspec% /c c:\WinNT\System32\MSIexec.exe /I "\\Server\Share\Path\PackageName.msi" /QB- /LIWMOE "c:\temp\PackageName-Install.log" ALLUSERS=1

  • This uses the Start command and the /w (wait) switch to start a new window and keep it open until the command completes:

%Comspec% /c Start /w c:\WinNT\System32\MSIexec.exe /I "\\Server\Share\Path\PackageName.msi" /QB- /LIWMOE "c: \temp\PackageName-Install.log" ALLUSERS=1

  • This /K switch will cause the command prompt window to remain open after completion. If your package shuts down the computer this should not be a problem, otherwise the command prompt will remain up. Try adding the command EXIT to the end of the batch file to close the command window:

%Comspec% /k c:\WinNT\System32\MSIexec.exe /I "\\Server\Share\Path\PackageName.msi" /QB- /LIWMOE "c:\temp\PackageName-Install.log" ALLUSERS=1
Exit

  • Finally, we have the old fashioned way. This just calls the executable manually and relies on the command interpreter being located in the path (which it normally is) and uses all default parameters in doing so:

c:\WinNT\System32\MSIexec.exe /I "\\Server\Share\Path\PackageName.msi" /QB- /LIWMOE "c:\temp\PackageName-Install.log" ALLUSERS=1