How to Stop Windows 11 from Automatically Deleting Previous Windows Installations (Windows.old)

When you upgrade Windows 11 to a major new feature version (like upgrading from 22H2 to 23H2), Microsoft doesn’t immediately delete your old operating system. It packages your previous system files into a massive folder named Windows.old on your C: drive, allowing you to easily roll back if the new update causes your PC to crash.

However, Windows 11’s automated maintenance utility (Storage Sense) is programmed to silently delete this Windows.old folder exactly 10 days after the upgrade to reclaim disk space. If you are experiencing weird, subtle bugs with the new update but don’t notice them until day 14, you will be permanently locked out of rolling back. If you have plenty of storage space, you can tell Windows to stop automatically deleting these crucial backup files.

How to Stop Storage Sense from Deleting Windows.old

You can adjust the rollback deletion timer using the Command Prompt, extending the window from 10 days to up to 60 days.

  1. Click the Start button, type cmd, and click Run as administrator on the right-hand panel. (Click “Yes” if prompted by UAC).
  2. In the black command prompt window, copy and paste the following exact command: DISM /Online /Set-OSUninstallWindow /Value:60
  3. Press Enter to execute the command.

This command instructs the Deployment Image Servicing and Management (DISM) tool to change the automatic deletion window to 60 days. Storage Sense will now completely ignore your Windows.old folder for a full two months, giving you ample time to thoroughly test a new Windows update before permanently committing to it.

Get the best tech tips delivered straight to your inbox.

Join thousands of readers mastering Apple, Google, Microsoft, and Linux.