Advertisement

Windows 10 setup.exe command line switches

The Windows 10 Setup program, or setup.exe which is part of the installation media, supports a set of command line arguments. Using those arguments, you can modify the behavior of Windows installation. In this article we will review command line switches available for setup.exe in Windows 10.

Windows 10 logo banner
So, Setup.exe installs or upgrades Windows. The following command line arguments can be used to modify the behavior of Windows installation:

Switch: /auto
Parameters : Upgrade; DataOnly; Clean
Action : Automate install with migration choice for the installation.
The media setup UI and progress screens are shown by default, but are automated.
This switch also assumes the following default configurations :
EULA acceptance, Dynamic Update is enabled, telemetry collection and upload opt - in, OOBE will be skipped, PBR will be updated or created.

Example : setup.exe /auto upgrade

Advertisеment

Switch : /quiet
Parameters : N /A

Action : The quiet flag will suppress any setup UX, including rollback UX

Example : setup.exe /auto upgrade /quiet

Switch : /pkey
Parameters : 5x5 product key

Action : Supplies setup with the specified product key.
This parameter is not necessary when upgrading with volume licensed media or media that contains a pid.txt in the sources folder.

Example : setup.exe /auto upgrade /pkey ABC12-DEF34-GHI56-JKL78-MNP90

Switch : /showoobe
Parameters : Full; None

Action : When /showoobe is set to Full, the end user must interactively complete OOBE.
Alternatively, when /showoobe is set to None, OOBE is skipped and components are set to their default settings.

Example : setup.exe /auto upgrade /showoobe full

Switch : /noreboot
Parameters : N /A

Action : Setup will not automatically reboot the PC when it completes down - level OS tasks.
The next time the PC is rebooted, setup will continue.

Example : setup.exe /auto upgrade /noreboot

Switch : /DynamicUpdate
Parameters : Enable; Disable

Action : Specifies whether setup will perform Dynamic Update operations (search, download, and install updates).

Example : setup.exe /auto upgrade /DynamicUpdate disable

Switch : /Postoobe \setupcomplete.cmd
Parameters : Local file path or UNC network path to a file named setupcomplete.cmd

Action : Injects setupcomplete.cmd file from the specified location.
Setupcomplete.cmd is a customized script to perform tasks after the installation completes but before first user login.
It is run with System privileges.

Example : setup.exe /auto upgrade /postoobe c:\script\setupcomplete.cmd

Switch : /Postrollback
Parameters : Local file path or UNC network path to a file named setuprollback.cmd

Action : Injects setuprollback.cmd file from the specified location.
Setuprolback.cmd is a customized script to perform tasks after the installation fails and the PC has rolled back to its previous OS.
It is run with the same privileges as the user or process that launched setup.

Example : setup.exe /auto upgrade /postrollback \MyShare\script\setuprollback.cmd

Switch : /installfrom
Parameters : Local file path or network path to a specific.wim

Action : Specifies location for installation source media /files

Example : setup.exe /auto clean /installfrom d:\myWim\customwim.wim

Switch : /PBRUpdate
Parameters : Enable; Disable

Action : When /PBRUpdate is set to Enable, setup will update or create the PBR partition.
Conversely, when /PBRUpdate is set to Disable, setup will not update or create the PBR partition

Example : setup.exe /auto upgrade /PBRupdate disable

Switch : /migratealldrivers
Parameters : All; None

Action : When /migratealldrivers is set to All, setup will attempt to migrate all drivers as part of the installation.
In contrast, when /migratealldrivers is set to None, setup will not migrate anydrivers as part of the installation.
NOTE: this switch should only be used in testing and test envoriments.It should not be used in production.

Example : setup.exe /auto upgrade /migratealldrivers none

Switch : /installdrivers
Parameters : Local file path or UNC network path to a folder that contains.inf files

Action : Setup will inject all driver.infs found in the specified location during the installation process.
Setup will recursively search through all the subfolders of the specified location.

Example : setup.exe /auto upgrade /installdrivers c:\myUpgrade\drivers

Switch : /Telemetry
Parameters : Enable; Disable

Action : When /Telemetry is set to Enable, setup will collect and upload telemetry generated by the installation.
However, when /Telemetry is set to Disable, setup will not collect and upload installation - related telemetry.

Example : setup.exe /auto upgrade /Telemetry enable

Switch : /copylogs
Parameters : Local file paths and UNC network paths

Action : Upon failure, setup will copy or upload compressed logs to the specified location.
Please note that the PC and /or user must have permission and network access to the specified file path.
This command runs in the system context so may not have permissions to copy to locations that require user permissions

Example : setup.exe /auto upgrade /copylogs \MyShare\UpgradeLogs

Here are some usage examples.

An admin wants to upgrade the departments PCs from Windows 7 Enterprise overnight. He does not want the setup user interface to appear, but he does want the end users to manually go through the Out of box experience(known as OOBE) experience.
The following command line can be used to orchestrate the full upgrade to Windows vNext, requiring user input only once the machine reaches OOBE :

Setup.exe /auto upgrade /quiet /showoobe full

Alternatively, a deployment engineer may want to collect logs and other diagnostic information from test PCs in the event of a failure.
The following command line instructs setup invoke the setuprollback.cmd script after an installation failure :

Setup.exe /auto upgrade /installdrivers c:\myUpgrade\drivers /postrollback c:\setuprollback.cmd

That's it. Have something to add? Welcome to comments! (via MDL).

Support us

Winaero greatly relies on your support. You can help the site keep bringing you interesting and useful content and software by using these options:

If you like this article, please share it using the buttons below. It won't take a lot from you, but it will help us grow. Thanks for your support!

Advertisеment

Author: Sergey Tkachenko

Sergey Tkachenko is a software developer who started Winaero back in 2011. On this blog, Sergey is writing about everything connected to Microsoft, Windows and popular software. Follow him on Telegram, Twitter, and YouTube.

12 thoughts on “Windows 10 setup.exe command line switches”

    1. Hi Sergey. Glad to see you here!
      Yeah, those commands are intended to be used from some running operating system.
      I have not tried to run it using the custom PE. Maybe in that case it is possible to get it working.

  1. This is great, the only question i have is i seem to get prompted about default language, is there anyway i can select the option to auto proceed on this?

      1. Not completely what i was looking for.

        I need to just Press ok, to the What needs your attention screen.

        This is stating that the Display Language is not correct however this is set to be English UK.

        1. Claire, I get the same issue did you manage to overcome your problem? If I follow the link it talks about using /unattend:unattend.xml but when I add this command in with a valid test xml I just get an error saying invalid command line arguments. It only works with;

          /auto upgrade /DynamicUpdate disable /copylogs \\SHARE\Logs /unattend:unattend.xml

          and does not work if I try:

          /auto upgrade /DynamicUpdate disable /copylogs \\SHARE\Logs /unattend:unattend.xml

          1. Hi Clare and Dean, I am also getting the same issue. Did you manage to find the solution?

  2. ‘setup.exe’ is not recognized as an internal or external command, operable program or batch file. How I can fix this?

Leave a Reply

Your email address will not be published.

css.php
Using Telegram? Subscribe to the blog channel!
Hello. Add your message here.