DISM operating system uninstall command-line options
OEMs shouldn't use this setting in imaging or manufacturing scenarios. This setting is for IT administrators.
Windows gives a user the ability to uninstall and roll back to a previous version of Windows. You can use DISM to:
- Find out how many days after an upgrade that an OS can be uninstalled
- Initiate an uninstall
- Remove the ability for a user to uninstall a Windows upgrade
- Set the number of days that a user has to uninstall a Windows upgrade
Run this command against an online image to see how many days after an upgrade that an uninstall can be initiated.
DISM /Online /Get-OSUninstallWindow
Run this command against an online image to revert a PC to a previous Windows installation.
DISM /Online /Initiate-OSUninstall [/NoRestart|/Quiet]
By default, you'll be prompted to restart the PC after running this command. You can choose to suppress the prompt by either specifying the /Quiet option, which allows the restart the happen automatically, or specifying the
/NoRestart option, which will require the PC to be restarted manually.
/Quiet options are available starting in Windows 10 Version 2004. In earlier versions of Windows 10, seccessful execution of this command does not produce any output, and the PC must be restarted manually. Running the command again after it has already succeeded will result in ERROR_NOT_FOUND (1168), but the uninstall will continue to proceed once the PC restarts.
Run this command against an online image to remove the ability to roll back a PC to a previous installation of Windows.
DISM /Online /Remove-OSUninstall
Sets the number of days after an upgrade that an uninstall can be initiated.
DISM /Online /Set-OSUninstallWindow /Value:<days>
Valuesets how many days after an upgrade that an uninstall can be initiated.
If you specify a value less than two or greater than 60, the system uses the default value of 10.
If days elapsed since installation is greater than this value, you cannot go back to the old version of Windows.
DISM /Online /Set-OSUninstallWindow /Value:30
For more info on rolling back from Windows 11 to Windows 10, see Downgrade from Windows 11 to Windows 10.