Fix it now
These two codes look related and are not. 0xC1900107 is a cleanup operation from a previous installation attempt still pending, and Microsoft’s mitigation is a restart followed by Disk Cleanup. 0xC190010A is MOSETUP_E_UNKNOWN_CMD_LINE – setup was launched with an argument it does not recognise, which is a problem with your command line rather than with the machine.
cleanmgr
net stop wuauserv
ren C:\Windows\SoftwareDistribution SoftwareDistribution.old
net start wuauserv
- Restart the machine and try the upgrade again before anything else. Microsoft’s published mitigation for 0xC1900107 starts here, and a genuinely pending file operation clears on the restart.
- Open Settings, Windows Update, install everything outstanding and restart until the device reports nothing pending.
- Run Disk Cleanup as administrator, choose Clean up system files, and tick Temporary Windows installation files and Previous Windows installation(s). This is the published second step and it removes setup’s working folders properly.
- If you are launching setup from a script or a deployment tool, run
setup.exeby hand from the same media first. If that works, the fault is in the command line and nothing on the machine needs fixing. - Check every switch against Microsoft’s published option list, and quote any path containing spaces. Watch for smart quotes pasted out of a document or a ticket.
- If 0xC1900216 is what you have, a pending operating system rollback is on the machine. Let it complete or resolve it before starting a new upgrade.
/EULA accept is required when you pass /Quiet. A quiet run without it is one of the easier ways to produce a command line setup rejects.
If setup gets past its initial checks into the download or copy stage, you are through this. If not, the next section covers what counts as pending and which switches setup actually takes.
Why it happens
Windows will not begin a feature update on top of another servicing operation that has not finished. 0xC1900107 is that refusal: Microsoft publishes it as a cleanup operation from a previous installation attempt still pending, with a system restart required to continue. The published mitigation is to restart the device and run setup again, and if that does not resolve it, use Disk Cleanup on the temporary files and the system files. That is the whole documented remedy, and it is deliberately conservative.
0xC1900216 is the most informative code in this set and used to be described here as a generic pre-installation check. It is MOSETUP_E_ROLLBACK_PENDING: ‘Found pending OS rollback operation.’ That is a specific and actionable statement – the machine is part way through undoing a previous upgrade, and starting a new one on top of that is not going to work.
0xC190010A and 0xC190010D come from the same executable and say nothing about the state of the machine. 0xC190010A is MOSETUP_E_UNKNOWN_CMD_LINE, the installation process was launched with an unknown command-line argument. 0xC190010D is MOSETUP_E_INVALID_CMD_LINE, launched with an invalid one. The distinction is between a switch setup has never heard of and a switch it knows with a value it will not take. Either way, the machine is fine and the script is not.
0x80070BC2 is Win32 3010, ERROR_SUCCESS_REBOOT_REQUIRED: ‘The requested operation is successful. Changes will not be effective until the system is rebooted.’ It is a success code. Where it turns up in this story it is usually the thing that created the pending state – an installer finished, asked for a restart, and never got one.
A restart is genuinely outstanding
You have this one if The error appears immediately, before any progress, and the machine has installed updates or drivers recently without being restarted.
- Restart. If updates install during shutdown, let them finish and restart a second time.
- Open Settings, Windows Update and install anything still listed, repeating until it reports the device is up to date with no restart required.
- Try the upgrade again before doing anything more invasive.
A pending flag survives every restart
You have this one if You have restarted several times and setup still reports 0xC1900107 the moment it starts.
- Run Disk Cleanup as administrator with Clean up system files, and remove temporary Windows installation files and previous Windows installations. This is Microsoft’s published second step.
- Check for a servicing flag: a
RebootPendingkey underHKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Component Based Servicing. - Check for queued file moves in
PendingFileRenameOperationsunderHKLM\SYSTEM\CurrentControlSet\Control\Session Manager. - Run
Dism.exe /online /Cleanup-Image /StartComponentCleanupand restart, which lets a stuck servicing operation finish tidying.
Clearing PendingFileRenameOperations discards work Windows intended to do. It is defensible when the entries belong to a product you have already removed, and a bad idea when they belong to a half-installed Windows update.
A pending operating system rollback
You have this one if 0xC1900216, on a machine where a previous upgrade rolled back or was interrupted.
- Let the rollback complete. Restart and allow the machine as long as it needs before intervening.
- Once it has settled, install outstanding updates and restart again so nothing else is pending.
- Use Disk Cleanup to remove the previous Windows installation, which is what the rollback was holding on to.
- Start the new upgrade only after
winvershows the build you expect and nothing reports a pending restart.
The command line is not one setup accepts
You have this one if 0xC190010A or 0xC190010D, and the upgrade only fails when launched from a script, task sequence or management tool.
- Run
setup.exemanually from the same media. Success there confines the fault to the command line. - Check each switch against the published list and its accepted values, rather than against memory or an old deployment script.
- Add
/EULA acceptif you are passing/Quiet; it is documented as required in that case. - Quote paths with spaces and retype any switch that has been through a word processor.
Something keeps re-arming the pending state
You have this one if The flags come back within minutes of every restart, on a managed machine.
- Check whether a management agent is mid-deployment and let it finish, or pause its maintenance window while you upgrade.
- Look for an installer that returned 0x80070BC2 and was never followed by the restart it asked for, and give it one.
- Run the upgrade inside a window when nothing else is scheduled to install.
Full reference
The five codes side by side
| Code | Published meaning |
|---|---|
0xC1900107 |
MOSETUP_E_CLEANUP_PENDING: a cleanup operation from a previous installation attempt is still pending; a restart is required |
0xC190010A |
MOSETUP_E_UNKNOWN_CMD_LINE: launched with an unknown command-line argument |
0xC190010D |
MOSETUP_E_INVALID_CMD_LINE: launched with an invalid command-line argument |
0xC1900216 |
MOSETUP_E_ROLLBACK_PENDING: found pending OS rollback operation |
0x80070BC2 |
Win32 3010, ERROR_SUCCESS_REBOOT_REQUIRED: successful, but changes need a restart |
The setup options Microsoft publishes
| Option | Accepted values | Notes |
|---|---|---|
/Auto |
Clean, DataOnly, Upgrade | Upgrade keeps apps and data |
/Compat |
IgnoreWarning, ScanOnly | ScanOnly runs the scans and exits |
/DynamicUpdate |
Enable, Disable, NoDrivers, NoLCU, NoDriversNoLCU | Controls what setup fetches mid-run |
/MigrateDrivers |
All, None | Whether existing drivers come across |
/ShowOOBE |
Full, None | None skips OOBE and takes defaults |
/Priority |
Normal, Low | Low runs setup at low thread priority |
/NoReboot |
– | Suppresses only the first restart after the down-level phase |
/Quiet |
– | Suppresses the setup experience, including the rollback experience |
/EULA |
accept | Required when /Quiet is used |
/CopyLogs |
A local or UNC path | Collects logs from an unattended run |
/PKey |
A product key | Supplies a key to setup |
Checking for a pending restart without editing anything
- Settings, Windows Update states plainly whether a restart is required.
Component Based Servicingcarrying aRebootPendingkey means servicing is waiting on one.PendingFileRenameOperationsunderSession Managerlists file moves queued for the next restart.- An installer that returned 0x80070BC2 has told you the same thing in its own log.
- Reading all four is quicker than deleting any of them, and tells you whether the pending state is real work or a leftover.
If you must remove setup’s folders by hand
- Use Disk Cleanup with Clean up system files first. It removes
$Windows.~BTand$Windows.~WSwithout permission problems and is what Microsoft publishes. - Copy out any logs you still need; they are the only thing of value in those folders.
- Only if a folder refuses to delete, take ownership with
takeown /f C:\$Windows.~BT /r /d yand grant access withicacls C:\$Windows.~BT /grant administrators:F /t. - Then remove it with
rd /s /q C:\$Windows.~BT. - Restart before starting the upgrade so setup creates its folders fresh.
When the upgrade only fails through your deployment tool
Start by proving the media and the machine are fine with a manual run, then compare the two command lines character by character. The accepted switch set changes between builds, so a line that has worked for years can be rejected outright by a newer setup.exe – which is exactly what MOSETUP_E_UNKNOWN_CMD_LINE says. Deployment tools also expand variables into paths with spaces, so a quoting problem that never showed up in testing appears the first time a machine has a different install path.
Every code this article covers
| Code | What it points at | Source |
|---|---|---|
0xC1900107 |
MOSETUP_E_CLEANUP_PENDING: a cleanup operation from a previous installation attempt is still pending and a restart is required to continue | Microsoft Learn |
0xC190010A |
MOSETUP_E_UNKNOWN_CMD_LINE: the installation process was launched with an unknown command-line argument | Microsoft Learn |
0xC190010D |
MOSETUP_E_INVALID_CMD_LINE: the installation process was launched with an invalid command-line argument | Microsoft Learn |
0xC1900216 |
MOSETUP_E_ROLLBACK_PENDING: found pending OS rollback operation | Microsoft Learn |
0x80070BC2 |
Win32 3010, ERROR_SUCCESS_REBOOT_REQUIRED: the operation succeeded but changes take effect only after a restart | Microsoft Learn |
Confirm the fix worked
- A restart no longer brings any of the pending markers back.
- Settings, Windows Update reports the device up to date with no restart required.
C:\$Windows.~BTandC:\$Windows.~WSare gone before the next attempt begins.- Setup gets past its initial checks into the download or copy stage rather than failing immediately.
- After the upgrade,
winvershows the new build and Disk Cleanup offers a previous Windows installation to remove.
Questions people ask about this
Does anything here need to be bought?
No. Every step is a restart, a built-in cleanup tool or a correction to a command line.
Is it safe to delete C:\$Windows.~BT by hand?
It is setup’s scratch space rather than part of Windows, so nothing but the logs from the failed attempt is lost. Microsoft’s published route is Disk Cleanup with Clean up system files, which handles ownership and permissions properly; hand deletion is the fallback when a folder refuses to go.
The error only appears through our deployment tool. Where do I start?
Run setup.exe by hand from the same media. If that works, the machine is fine and the command line is the fault – which is exactly what 0xC190010A means.
What is 0xC1900216 telling me?
That the machine has a pending operating system rollback. Let that finish before you start anything new; a fresh upgrade layered on an incomplete rollback is not a supported state.
How do I check for a pending restart without touching the registry?
Settings, Windows Update says so directly, and an installer that returned 0x80070BC2 has already told you. The registry keys are useful when you need to know which subsystem is waiting, not to find out whether something is.
