On Windows 10, a copy of the previous installation (known as the Windows.old folder) is created during the upgrade process to a new version, in case that the installation fails and rollback is required, or things are not working as expected and you need to go back to the previous version.
The only problem with this mechanism is that if the installation completed successfully the system deletes the previous version files automatically after ten days to free up space. This means that if you have problems after the Windows.old folder was deleted, you’ll no longer have the “Go back to the previous version of Windows 10” option in the Recovery settings page.
Starting with the Windows 10 version 1803 (April 2018 Update), Microsoft is adding new commands options to its Deployment Image Servicing and Management (DISM) tool to extend the time which allows you to uninstall an upgrade after it’s installed.
In this guide, you’ll learn the steps to use DISM commands to set the number of days after an upgrade that you can uninstall the upgrade before the system deletes the previous version.
How to change number of days to uninstall Windows 10 upgrade
In order to stop Windows 10 from deleting previous installation files and removing the uninstall option after the ten days you installed a new version, use these steps:
-
Open Start.
-
Search for Command Prompt, right-click the top result, and select Run as administrator.
-
Type the following command to see the current time window to uninstall an upgrade of Windows 10 and press Enter:
DISM /Online /Get-OSUninstallWindow
-
Type the following command to set the number of days before the previous installation is deleted and press Enter:
DISM /Online /Set-OSUninstallWindow /Value:60
Quick Tip: The above command changes the default value from the default 10 to 60 days. You can change 60 for any number of days you want to retain the previous version, but bear in mind that 60 is the maximum number, any value over 60 will not work, and it’ll set the option to 10 days.
Once you’ve completed the steps, in the future, you’ll be able to rollback to a previous version of Windows 10 using the recovery options within the number of days you specified. Just remember that you have to do this every time, immediately, after an upgrade.