Windows 10

Windows 10 Rollback (SetupRollback.cmd)

Update: This article is for reference only, as you should no longer be deploying old media where this was an issue.  All new versions of 1909 and newer that you’d be deploying through ConfigMgr will no longer have the issue as described in this article.

This might not be a widely known fact, but Rollback in Windows 10 has been partially broken for a very long time (1803), and still is with current media of 1809 & 1903 as of today, 2019/08/20. In this post we deep dive into what the issue is and what you can do to fix it.

What is exactly broken? SetupRollback.cmd is not triggered in Windows if the machine fails the upgrade process.

Why should I care?  If you have created your own SetupRollback.cmd file, or expect to leverage it in the case of an upgrade failure and the machine rolls back, you will not get the experience you are expecting.  The Same goes for OS Uninstall (Revert back to Previous OS).  You would need to rely on outside processes to restore full functionality to the machine.  You know that folder in the In-Place Upgrade Task Sequence Template that says Rollback, with the condition _SMSTSSetupRollback = True.. guess what never gets set if the SetupRollback.cmd file never gets run?  Yep, that variable to trigger the RollBack Section of your Upgrade TS.

Setup Rollback Template

What should I do if I need this?  This is a two part fix.  Both Windows upgrade media needs an update (Dynamic Update, August and newer for 1809) and ConfigMgr needs a Variable Set. As of now, I don’t know if there is a fix for Win 10 1903.. still coming?  I have been told it will be built into Win 10 1909 whenever that is released.

  1. ConfigMgr: In the Task Sequence, you need to leverage /postrollbackcontext command, and set it to system (/postrollbackcontext system) otherwise it will try to launch SetupRollback.cmd in the user context, which helps nobody.  This behavior is supposed to change in 1910, and that will be the default which we should be able to confirm at that point.
  2. Windows Upgrade Media:  A couple ways to do this.  Enable Dynamic Updates during your Upgrade.  This by far is the easiest way, if your infrastructure can handle it.  If it can’t be enabled, you’ll need to “inject” them into your offline media.  There are several guides out there on how to accomplish this (including below), along with a community tool, OSDBuilder, which will help automate the process.  Short Version.. Download the KB, extract the CAB file, copy the extracted files / folder structure into your Upgrade Media overwriting the files that were previously there.

Updating Offline Media (ConfigMgr 1809 Source Content)

Updating Offline Media

Download, then Extract (expand):

Download, then extract

Go to folder: (Contents of the Extracted KB)

Go to folder: contents of the extracted KB

Copy to your 1809 Upgrade Media

Copy to your 1809 Upgrade Media

Now update your DPs with your latest upgrade media, and you’re set.  Please make sure you’re also updating it with the other monthly patches and dynamic updates.In the Task Sequence:Set Variable Step:

ConfigMgr Win10 Task Sequence Editor

Upgrade Step (If you can update Dynamic Updates):

Upgrade Step (If you can update Dynamic Updates)

Now with the Rollback Mechanism working properly, the Task Sequence is supposed to kick back in after the machines fails to upgrade, allowing you to run additional cleanup / diagnostic tasks (Like trigger SetupDiag for example).Originally posted on


  • This field is for validation purposes and should be left unchanged.


  • This field is for validation purposes and should be left unchanged.

By submitting this form, you understand that Recast Software may process your data as described in the Recast Software Privacy Policy.