Manage Learn to apply best practices and optimize your operations.

Set Win10 RS5 Rollback Retention Interval

I don’t normally write much about the Insider Preview builds for this blog post. Practicing Enterprise admins have enough on their hands keeping up with current branch versions of the OS. But when I see new features of potential benefit, I break that restriction happily. As of Build 17682, the built-in Deployment Image Servicing and Management (DISM) command gains an interesting new capability. At the command line, you can tell it to alter the default 10-day retention period for keeping Windows.old around. That means when the next version of Windows 10 goes into production, you can set a rollback period of your choosing simply and easily. Thus, it’s piece of cake to set Win10 R5 rollback retention interval however you like it.

How to Set Win10 RS5 Rollback Retention Interval?

Here’s a PowerShell screen capture that shows me:

  • inquiring about the current interval
  • re-resetting that interval to 12 days
  • showing that changed value

Set Win10 RS5 Rollback Retention Interval.dism-examples

DISM /ONLINE is a given, because we’re working on a loaded (and running) Windows image. The new cmdlets are Get-OSUninstallWindow and Set-OSUninstallWindow.
[Click on image for full-sized view.]

The syntax for Get-OSUninstallWindow is dead simple. By itself, it shows you the current number of days the OS will keep Windows.old around, thereby allowing rollback to occur. Set-OSUninstallWindows takes an integer value for the /Value attribute. It resets the retention interval to whatever number of days you specify. Thus, I show the intial value as a default of 10 days. I reset that to 12 days, and use Get-OSUninstallWindow again to show the change has been applied.

What’s Your OSInstallWindow Choice?

It’s whatever you want it to be. If you build canonical images for deployment, you can use this DISM command on a running instance of that canonical OS to make this change while it’s online. Note that MS Docs “DISM operating system uninstall command-line options” includes this warning: “OEMs shouldn’t use this setting in imaging or manufacturing scenarios. This setting is for IT administrators.” That said, I don’t see a downside to changing this in a canonical image prior to its deployment to testing or production. And then, your rollback interval will be whatever you choose!

What If These Commands Don’t Work? [Added 6/25/18]

If you don’t have a Windows.old folder on your PC you can’t use the Get or Set -OSUninstallWindow parameters on DISM successfully. I can’t say why MS did this, but if you run either command on a Windows 10 1803 or higher PC that has already been cleaned up after its most recent upgrade, you’ll get an error that reads “The system cannot find the path specified.” That’s because the command goes off looking for Windows.old. If it doesn’t find that entry, you get the error. If it does find the entry, get shows you the current size of that window in days, while set lets you change the value from its default of 10 days. You’ve been warned. Go Figure!

Virtual Desktop
SearchWindowsServer
Close