Freigeben über


Windows Setup Command-Line Options

Applies To: Windows 8, Windows 8.1, Windows Server 2012, Windows Server 2012 R2

The following command-line options are available for Windows Setup:

setup.exe [/1394debug:<channel> [baudrate:<baudrate>]]

[/addbootmgrlast]

[/auto: {data | upgrade} [/noautoexit] [/performDU]

[/busparams:<bus.device.function>]

[/debug:<channel> [baudrate:<baudrate>]]

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

[/installfrom:<path>] [/m:<folder_name>] [/noreboot] [/tempdrive:<drive_letter>]

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

[/unattend:<answer_file>]

[/usbdebug:<hostname>]

[/wdsdiscover]

[/wdsserver:<servername>]

Setup Command-Line Options

The following table lists Setup command-line options:

Option Description

[/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: {data | upgrade} [/noautoexit] [/performDU]]

Performs an automated upgrade to 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, an checks compatibility issues before starting the installation. If ei.cfg is malformed, setup exits silently and logs an exit code.

data: Performs an upgrade of Windows, saving only data (and not apps.) If the data-only installation option is not available due to compatibility checks, Windows Setup will exit silently and log an exit code.

upgrade: Performs an upgrade of Windows saving apps and data. If the upgrade installation option is not available, or the user needs to resolve an app compatibility issue, Windows Setup will exit silently and log an exit code.

Setup.exe exit codes:

 

Exit code name Exit code Cause

CONX_SETUP_EXITCODE_CONTINUE_REBOOT

0x3

This upgrade was successful.

CONX_SETUP_EXITCODE_RESUME_AT_COMPAT_REPORT

0x5

The compatibility check detected issues that require resolution before the upgrade can continue.

CONX_SETUP_EXITCODE_AUTO_INSTALL_FAIL

0x7

The installation option (upgrade or data only) was not available.

/noautoexit: If an error is found, Windows Setup does not exit, but instead stops and stays on the setup screen until the user addresses the issue. The installation from that point on is attended.

/performDU: When used, Windows Setup checks for Dynamic Updates for Windows Setup.

Examples:

Setup /auto:data

Setup /auto:upgrade

Setup /auto:data /noautoexit

Setup /auto:upgrade /performDU

Setup /auto:upgrade /noautoexit /performDU

[/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.

[/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 /1394debug:1 /baudrate:115200

[/emsport: {COM1 | COM2 | usebiossettings | 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.

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 can also be set to 57600 or 115200. For example:

Setup /emsport:COM1 /emsbaudrate:115200

[/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

[/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 Files\Messenger\Msmsgs.exe file into the Windows installation, create the following folder structure on the Pro\Sources\$OEM$\$Progs\Messenger\Msmsgs.exe installation source by using the Setup command:

Pro\sources\setup.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:\Windows\i386 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:

Pro\sources\$OEM$\$$\i386\msmsgs.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\$$\i386\msmsgs.ex_

If you change resources in your replacement files, you must add the updated Multilanguage User Interface (MUI) files to the installation.

[/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.

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=1,key=0.0.0.0

setup /netdebug:hostip=10.125.4.86,port=1,key=abcdefg.123.hijklmnop.456,nodhcp

setup /netdebug:hostip=10.125.4.86,port=1,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

[/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.

<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.

Setup /unattend:\\server\share\unattend.xml

[/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

See Also

Reference

Windows Setup States
Windows Setup Edition Configuration and Product ID Files (EI.cfg and PID.txt)

Concepts

Windows Setup Log Files and Event Logs