Microsoft Silent Install Switches

The following table identifies the standard command-line options for this program. Command-line options are case insensitive. Windows Installer 2.0: The command-line options that are identified in this topic are available beginning with Windows Installer 3.0. The Windows Installer Command-Line Options are available with Windows Installer 3.0 and earlier versions. It doesn't appear the beta includes support for a scripted silent install, is that so? If it does, where can I find the switches documented? If it does not, is that planned? (I am hoping to use the product, when released, for computers in a school lab and would greatly appreciate a silent, scripted install.) Jonathan.

Installshield silent install

Programming, graphics, games, media, C++, Windows, Internet and more...

Blog »

# Installing Visual C++ Redistributable Package from Command Line

Wed
20
May2015

You may think that unless you explicitly use some external library (like FMOD), your program will not require any additional libraries to work, but when coding in C++ using Visual Studio, this is not the case. The functions of standard C/C++ library are implemented in a package of DLL-s called Microsoft Visual C++ Redistributable Package. Each version of Visual Studio has their own set. For example, version for Visual Studio 2013 (Release configuration) consists of files: msvcr120.dll, msvcp120.dll.

You can make your application not requiring this library by setting your project options in Configuration Properties > C/C++ > Code Generation > Runtime Library to 'Multi-threaded [Debug]' without the 'DLL' part, which makes it statically linked. Alternatively, you can distribute these DLL files (although I'm not sure if this is legal) or the whole library installer together with your application. The library is small and free, available to download from Microsoft website:

Microsoft Silent Install Switches

Microsoft Silent Install Switches
  • 2008 SP1: x86, x64
  • 2010 SP1: x86, x64
  • 2012 Update 4 (all versions)
  • 2013 (all versions)
  • 2015 Update 3 (all versions)

The question is: can you launch the installer of these packages with some special parameter so the user doesn't have to go through all the setup wizard, confirming each step? The answer is yes, but as Microsoft likes to change everything very often :) the exact command line is different depending on version. Here is the whole set:

Visual Studio 2005 (original one):

Visual Studio 2005, x86 (32-bit version):
vcredist_x86.exe /q:a /c:'VCREDI~1.EXE /q:a /c:'msiexec /i vcredist.msi /qn'
Visual Studio 2005, x64 (64-bit version):
vcredist_x64.exe /q:a /c:'VCREDI~2.EXE /q:a /c:'msiexec /i vcredist.msi /qn' '
Visual Studio 2005 SP1, x86:
vcredist_x86.exe /q:a /c:'VCREDI~3.EXE /q:a /c:'msiexec /i vcredist.msi /qn' '
Visual Studio 2005 SP1, x64:
vcredist_x64.exe /q:a /c:'VCREDI~2.EXE /q:a /c:'msiexec /i vcredist.msi /qn' '

If you would like to install it in unattended mode (which will show a small progress bar but not require any user interaction), you can change the '/qn' switch above to '/qb'. Unattended mode + disabled 'Cancel' button is '/qb!'.

Visual Studio 2005 (updated - the one I use):

/Q - quiet mode

Visual Studio 2008: Just pass one of these parameters:

/q - quiet mode, no user interface.
/qb - unattended mode, shows progress bar but no user interaction required.
/qb! - unattended mode with 'Cancel' button disabled.

Visual Studio 2010 and 2012:

/q /norestart - quiet mode
/passive /norestart - passive (unattended) mode

Visual Studio 2013, 2015, 2017:

/install /quiet /norestart - quiet mode
/install /passive /norestart - passive (unattended) mode

To quickly install all of these libraries on the machines where lots of different applications are launched that may require them, I gathered all the libraries in one directory and I have written following BAT script:

Update: I also prepared a full package with my script and 'pirated' copy of all these installers for your convenience: Microsoft Visual C++ Redistributable Package.zip (105 MB).

Find Switches For Exe

Comments | #visual studio#c++Share

Please enable JavaScript to view the comments powered by Disqus.
Copyright © 2004-2019 Sorry, you need Javascript on to email me.
-->

The following command-line options are available for Windows Setup. Beginning with Windows 10, version 1607, you can use a setupconfig file as an alternative to passing paramters to Windows Setup on a command line. For more information, see Windows Setup Automation Overview.

setup.exe

The following table lists Setup command-line options:

OptionDescription

/1394Debug:<channel> [BaudRate:<baudrate>]

Enables kernel debugging over an IEEE 1394 (FireWire) port while Windows is running and during the windowsPE configuration pass of Windows Setup.
<channel> specifies the debugging channel. The default value for <channel> is 1.
[baudrate:<baudrate>] specifies the baud to use when Windows transfers data during debugging. The default setting is 19200. You can also set the <baudrate> setting to 57600 or 115200. For example:

Setup /1394debug:1 /baudrate:115200

/AddBootMgrLast

Instructs Windows Setup to add the Windows Boot Manager as the last entry in the UEFI firmware boot order. This option is only supported on UEFI PCs running Windows PE 4.0 or later.

/Auto{Clean | DataOnly | Upgrade}

Performs an automated upgrade to Windows 10 or Windows 8.1 volume license editions only.
When /auto is used, an unattend file cannot be used.
When /auto is used, Windows Setup consumes ei.cfg, and checks compatibility issues before starting the installation. If ei.cfg is malformed, setup exits silently and logs an exit code.
Clean: Performs an clean install of Windows.
DataOnly: Performs an upgrade of Windows, saving only data (and not apps.) If the color='red'>Setup /auto clean
Setup /auto dataonly
Setup /auto upgrade

/BitLocker{AlwaysSuspend | TryKeepActive | ForceKeepActive}

Specifies the BitLocker status during upgrades.
AlwaysSuspend: BitLocker is always suspended during an upgrade.
TryKeepActive: Attempts an upgrade without suspending BitLocker. If the upgrade fails, Windows Setup will suspend BitLocker and complete the upgrade. This is the default behavior if the /bitlocker option is not specified.
ForceKeepActive: Enables upgrading without suspending BitLocker. If the upgrade can't be completed because BitLocker is active, the upgrade will fail.

/BusParams:<bus.device.function>

Specifies the PCI address of a 1394, USB, or NET debug port. The bus, device, and function numbers must be in decimal format. Example:

Setup /busparams:0.29.7

For more info, see Setting Up Kernel Debugging with USB 2.0.

/CompactOS {Enable / Disable}

Specifies whether to use the Compact OS feature to save hard drive space. By default, Windows Setup determines whether to use this feature automatically.
Enable: Setup installs Windows using compressed system files.
Disable: Setup installs Windows using uncompressed system files
To learn more about Compact OS, see Compact OS, single-instancing, and image optimization.
Setup /compactos enable

/Compat {IgnoreWarning / ScanOnly}

IgnoreWarning: Setup completes installation, ignoring any dismissible compatibility messages.
ScanOnly: Windows Setup runs through compatibility scans, and then exits (without completing the installation) with an exit code to indicate if any compatibility concerns are present. Setup will return 0xC1900210 if no concerns are found. Setup will return 0xC1900208 if compatibility concerns are found.
Example:
Setup /compat IgnoreWarning
If you launch Setup with /Compat ScanOnly:

  • If it does not find any compat issue, it will return MOSETUP_E_COMPAT_SCANONLY (0xC1900210)
  • If it finds Actionable compat issues, like Apps, it will return MOSETUP_E_COMPAT_INSTALLREQ_BLOCK (0xC1900208)
  • If it finds that the Mig-Choice selected is not available, it will return MOSETUP_E_COMPAT_MIGCHOICE_BLOCK (0xC1900204)
  • If it finds that machine is not eligible for Windows 10, it will return MOSETUP_E_COMPAT_SYSREQ_BLOCK (0xC1900200)
  • If it finds that machine does not have enough free space to install, it will return MOSETUP_E_INSTALLDISKSPACE_BLOCK (0xC190020E)
This command works with other switches. For example, to run Setup in the background without any UI:
Setup /Auto Upgrade /Quiet /Compat ScanOnly
To ignore common disclaimers in the UI, for example, language changes:
Setup /Auto Upgrade /Quiet /Compat ScanOnly /Compat IgnoreWarning
Most of the time, an Admin would like to look at the compat XML if Setup found compat issues. For that the admin can even use copy logs flag to collect Setup logs:
Setup /Auto Upgrade /Quiet /Compat ScanOnly /Compat IgnoreWarning /CopyLogs C:TempLogfiles.log
This setting is new for Windows 10.

/CopyLogs<location>

Setup will copy or upload logs(compressed) upon failure to the specified location (assuming machine/user has permission and network access to location).
Accepted parameters are local file paths and UNC network paths.
Note: This runs in the system context, so it may not have permissions to copy to locations that require user permissions.
Example:
Setup /copylogs servershare

/Debug:<port> [BaudRate:<baudrate>]

Enables kernel debugging over a communications (COM) port when Windows is running, and during the windowsPE configuration pass of Windows Setup.
<port> specifies the debugging port. The default value for <port> is 1.
[baudrate:<baudrate>] specifies the baud to use when Windows transfers data during debugging. The default setting is 19200. You can also set the <baudrate> setting to 57600 or 115200. For example:
Setup /debug:1 /baudrate:115200

/DiagnosticPrompt {enable | disable}

Specifies that the Command Prompt is available during Windows Setup.
Enable: The Command Prompt can be accessed by pressing Shift+F10 during Windows setup.
Disable: The Command Prompt is not available during Windows setup. The Command Prompt wil not be available while offline and OOBE phases are running. This is the default setting.
Example:
setup /DiagnosticPrompt enable
This setting is new for Windows 10, Version 1703.

/DynamicUpdate {enable | disable}

Specifies whether setup will perform Dynamic Update operations (search, download, and install updates). Example:
setup /auto upgrade /DynamicUpdate disable

/EMSPort: {COM1 | COM2 | off} [/emsbaudrate:<baudrate>]

Enables or disables Emergency Management Services (EMS) during Windows Setup and after the server operating system has been installed. The following arguments are used to specify the behavior of EMS during Windows Setup.
COM1 enables EMS over COM1. Supported for x86 systems only.
COM2 enables EMS over COM2. Supported for x86 systems only.
usebiossettings uses the setting that the BIOS specifies. For x86 systems, Windows uses the value from the Serial Port Console Redirection (SPCR) table. If no SPCR table or EFI console device path is specified in the BIOS, Windows disables usebiossettings.usebiossettings
off disables EMS. If EMS is disabled in Windows Setup, you can later enable EMS by modifying the boot settings.
[/emsbaudrate:<baudrate>] specifies the baud to use when Windows transfers data during debugging. The default is 19200. You can also set the <baudrate> setting to 57600 or 115200. For example:
Setup /emsport:COM1 /emsbaudrate:115200

/InstallDrivers<location>

Adds .inf-style drivers to the new Windows 10 installation. The driver .inf can be in a folder within the specified location. The command will recurse through the specified location.
Accepted parameters are a local file path or UNC network path to a folder that contains .inf files. Example:
setup.exe /auto upgrade /installdrivers C:Fabrikamdrivers /noreboot
This setting is new for Windows 10.

/InstallFrom<path>

Specifies a different Install.wim file to use during Windows Setup. This enables you to use a single preinstallation environment to install multiple versions of Windows images. For example, you can use a 32-bit version of Windows Setup to deploy a 64-bit Windows image. You can also use an answer file for cross-platform deployments. For more information, see “Creating a WIM for Multiple Architecture Types” in Windows Setup Supported Platforms and Cross-Platform Deployments.
<path> specifies the path of the .wim file to install. For example:
Setup /installfrom D:custom.wim
Can also be used with split image files (.swm). Select the first split image file in the series, for example:
Setup /installfrom D:install.swm

/InstallLangPacks<location>

Adds language packs (lp.cab) to the new Windows 10 installation.
The language packs can be in a folder within the specified location. The command installs all lp.cab files and language capabilities such as text-to-speech recognition, in the folder and subfolders at the specified location.
Accepted parameters are a local file path or UNC network path to a folder that contains .inf files.
setup /auto upgrade /installlangpacks C:FabrikamLanguagesFrench /noreboot
This setting is new for Windows 10.

/m:<folder_name>

Instructs Setup to copy alternate files from an alternate location. This option instructs Setup to look in the alternate location first, and, if files are present, to use them instead of the files from the default location.
<folder_name> specifies the name and the location of the folder that contains the replacement files and can be any local drive location. UNC paths are not supported.
You must know where the files will be installed on the Windows installation. All the additional files must be copied to an $OEM$ folder in your installation sources or in the <folder_name>. The $OEM$ structure provides a representation of the destination installation disk. For example:
$OEM$$1
maps to %SYSTEMDRIVE%, which could be drive C.
$OEM$$$
maps to %WINDIR%, which could be C:windows.
$OEM$$progs
maps to the program files directory.
$OEM$$docs
maps to the user's My Documents folder.
For example, to copy an updated C:Program FilesMessengerMsmsgs.exe file into the Windows installation, create the following folder structure on the ProSources$OEM$$ProgsMessengerMsmsgs.exe installation source by using the Setup command:
Prosourcessetup.exe /m
If you replace a file that Windows file protection protects, you must also copy the updated file to the local sources to be installed with Windows. For example, you may copy the file to the C:Windowsi386 folder. The file name must be the same as the name that is used in Windows Setup. For example, add the following file and folder structure to your $OEM$ directory:
Prosources$OEM$$$i386msmsgs.ex_
If you use files that are not on an installation share, you must specify the folder name. In this example the <folder_name> is C:additional_files:
Setup /m:C:additional_files
where C:additional_files is your customized $OEM$ directory. For example:
C:additional_files$$i386msmsgs.ex_
If you change resources in your replacement files, you must add the updated Multilanguage User Interface (MUI) files to the installation.

/MigNEO Disable

Tells Windows Setup to perform an upgrade of Windows without additional offline phase optimizations. This option is available in Windows 10, version 1803 and later.

/MigrateDrivers {all | none}

Instructs Setup whether to migrate the drivers from the existing installation during the upgrade. You can specify All or None. By default, Setup decides which is best for each individual driver based on the install choice.
You can use this switch with /installdrivers, though it's not required.
Setup /auto upgrade /migratedrivers all
Setup /auto upgrade /migratedrivers none /installdrivers N:NewDrivers

/NetDebug:hostip=<w.x.y.z>,port=<n>,key= <q.r.s.t>[,nodhcp][,busparams=n.o.p]

Enables kernel debugging over the network.
Use hostip to identify the IP address of the host computer.
Use port to identify the port. The default start port is 49152, and the default end port is 65535.
Use key to provide a password to set up a secure connection.
Use nodhcp to avoid using a DHCP connection. (optional)
Use busparams to select the bus number, device number, and function number of an adapter for a specific PCI bus device. (optional)
Examples:
setup /netdebug:hostip=10.125.4.86,port=50000,key=0.0.0.0
setup /netdebug:hostip=10.125.4.86,port=50000, key=abcdefg.123.hijklmnop.456,nodhcp
setup /netdebug:hostip=10.1.4.8,port=50000, key=dont.use.previous.keys,busparams=1.5.0
For details, see Setting Up Kernel-Mode Debugging over a Network Cable Manually.

/NoReboot

Instructs Windows Setup not to restart the computer after the down-level phase of Windows Setup completes. The /noreboot option enables you to execute additional commands before Windows restarts. This option suppresses only the first reboot. The option does not suppress subsequent reboots. For example:
Setup /noreboot

/PKey<product key>

Supplies Setup with the specific product key. Example:
setup.exe /auto upgrade /pkey xxxxx-xxxxx-xxxxx-xxxxx-xxxxx
This setting is new for Windows 10.

/Priority Normal

Tells Windows Setup to increase the thread priority from low to high for feature updates through Windows Update. This option is available in Windows 10, version 1709 and later Note: Media based installations already run at normal priority.

/PostOOBE<location> [setupcomplete.cmd]

After Setup is complete, run a script.
Accepted parameters are a local file path or UNC network path to a file named setupcomplete.cmd or to a folder that contains setupcomplete.cmd.
setup.exe /auto upgrade /postoobe c:Fabrikamsetupcomplete.cmd
Path to folder that contains a script with the name: setupcomplete.cmd: Copies setupcomplete.cmd to $Windows.~BT to be run after OOBE.
setup.exe /auto upgrade /postoobe c:Fabrikam
This setting is new for Windows 10.

/PostRollback<location> [setuprollback.cmd] [/postrollbackcontext {system / user}]

If the feature update fails to install and rolls back the changes, or if the user chooses to uninstall the feature update and go back to a previous version of Windows, run a script.
Accepted parameters are a local file path or UNC network path to a file named setuprollback.cmd, or to a folder that contains setuprollback.cmd.
By default, updates from media run setuprollback.cmd in user context, which requires the first user who logs in post-upgrade to have administrator rights. For updates from Windows Update, setuprollback.cmd runs in system context, regardless of the rights of the first logged-in user. The postrollbackcontext option allows you to specify whether the script runs in the context of the System account or the account of the signed in user.
setup.exe /auto upgrade /postrollback c:Fabrikamsetuprollback.cmd
Path to folder that contains a script with the name: setuprollback.cmd: Copies setuprollback.cmd to $Windows.~BT to be run after OOBE.
setup.exe /auto upgrade /postrollback servershare
setup.exe /postrollback C:Fabrikamsetuprollback.cmd /postrollbackcontext user
/postrollbackcontext is new for Windows 10, version 1803.

/Quiet

This will suppress any Setup user experience including the rollback user experience. Example:
setup /auto upgrade /quiet
This setting is new for Windows 10.

/ReflectDrivers<location>

Specifies the path to a folder that contains encryption drivers for a computer that has third-party encryption enabled.
Setup /ReflectDrivers
This setting is new for Windows 10, version 1607.
Make sure that <folder_path> contains only a minimal set of encryption drivers. Having more drivers than necessary in <folder_path> can negatively impact upgrade scenarios.

/ResizeRecoveryPartition {Enable / Disable}

Specifies whether it's OK to resize the existing Windows Recovery Environment (Windows RE) partition or create a new one during installation.
Enable: During installation, Windows can resize the existing Windows RE tools partition or create a new one if needed.
Disable: Windows does not resize the existing Windows RE tools partition or create a new one during installation.
To learn more about Windows RE partitions, see UEFI/GPT-based hard drive partitions and BIOS/MBR-based hard drive partitions.
Setup /resizerecoverypartition disable

/ShowOOBE {full / none}

full: Requires the user to interactively complete the out of box experience (OOBE).
none: Skips OOBE and selects the default settings.
Example:
setup.exe /auto upgrade /showoobe full
This setting is new for Windows 10.

/Telemetry {Enable / Disable}

Specifies whether Windows Setup should capture and report installation data.
Enable: Setup captures and reports installation data.
Disable: Setup does not capture and report installation data.
Setup /telemetry disable

/TempDrive<drive_letter>

Instructs Windows Setup to put temporary installation files on the specified partition. For an upgrade, the /tempdrive option affects only the placement of temporary files. The operating system is upgraded in the partition from which you run the Setup.exe file.
The /tempdrive parameter is available in Windows 10, version 1607, but it is not available in earlier versions of Windows 10.
<drive_letter> specifies the partition to copy installation files to during Windows Setup. For example:
Setup /tempdrive H

/Unattend:<answer_file>

Enables you to use an answer file with Windows Setup. This is known as an unattended installation. You must specify a value for <answer_file>. Windows Setup applies the values in the answer file during installation.
<answer_file> specifies the file path and file name of the unattended Windows Setup answer file.
When /Unattend is used, /Auto cannot be used.
Setup /unattend:servershareunattend.xml

/Uninstall {enable / disable}

Determines whether Windows will include controls that allow the user to go back to the previous operating system.
This setting is new for Windows 10.
Setup /uninstall disable

/USBDebug:<hostname>

Sets up debugging on a USB port. Debug data is effective on the next reboot.
<hostname> specifies the name of the computer to debug. For example:
Setup /usbdebug:testmachine01

/WDSDiscover

Specifies that the Windows Deployment Services (WDS) client should be in discover mode.
If you do not specify /wdsserver with this option, WDS searches for a server. For example, to start the WDS client in this dynamic discover mode, run the following command:
Setup /wds /wdsdiscover

/WDSServer:<servername>

Specifies the name of the Windows Deployment Services server that the client should connect to.
To use this setting, you must also use the /wdsdiscover option.
<servername> can be an IP address, a NetBIOS name, or a fully qualified domain name (FQDN). For example, to start the Windows Deployment Services client in this static discover mode, run the following command:
Setup /wds /wdsdiscover /wdsserver:MyWDSServer

Setup.exe exit codes

Msi Silent Install

Exit code nameExit codeCause
CONX_SETUP_EXITCODE_CONTINUE_REBOOT0x3This upgrade was successful.
CONX_SETUP_EXITCODE_RESUME_AT_COMPAT_REPORT0x5The compatibility check detected issues that require resolution before the upgrade can continue.
CONX_SETUP_EXITCODE_AUTO_INSTALL_FAIL0x7The installation option (upgrade or data only) was not available.

Related topics