Delen via


DISM operating system uninstall command-line options

Important

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

/Get-OSUninstallWindow

Run this command against an online image to see how many days after an upgrade that an uninstall can be initiated.

Example:

DISM /Online /Get-OSUninstallWindow

/Initiate-OSUninstall

Run this command against an online image to revert a PC to a previous Windows installation.

Example:

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.

Note

The /NoRestart and /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.

/Remove-OSUninstall

Run this command against an online image to remove the ability to roll back a PC to a previous installation of Windows.

Example:

DISM /Online /Remove-OSUninstall

/Set-OSUninstallWindow

Sets the number of days after an upgrade that an uninstall can be initiated.

Syntax:

DISM /Online /Set-OSUninstallWindow /Value:<days>
  • Value sets 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.

Warning

If days elapsed since installation is greater than this value, you cannot go back to the old version of Windows.

Example:

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.

DISM Image Management Command-Line Options

Deployment Image Servicing and Management (DISM) Command-Line Options