Go to ...
RSS Feed

DISM: Change UninstallOSWindow

Having just gone back to check the date, I’m amazed to be reminded the default change to the OS clean-up interval from 30 to 10 days goes back to Version 1607, aka the Anniversary Update. I first wrote about this in August 2016 for my Windows Enterprise Desktop blog at TechTarget. When this release emerged, MS changed a long-time default. It used to be that the OS itself would keep the Windows.old folder around for 30 days. But with 1607, that interval was chopped to 10 days. Because the OS itself will only permit you to roll back to the previous version as long as those files stick around, this may not be long enough for some people who’d like to keep their options option a while longer. No problem! DISM will let you reset that interval at your discretion.

Using DISM to Change the UninstallOSWindow

As with many things DISM-related, the secret comes from knowing the syntax of the right command to use. First off, you can check the current retention interval. DISM calls this the OSUninstallWindow, and it’s measured in whole days. Given that the default is now 10 days, the results should come as no surprise. The specific DISM command to use with /online (to check the running Windows 10 install) is Get-OSUninstallWindow. Here ’tis.

The related Set- command in DISM allows admin users to change the size of the window. Here’s an example where I change it from 10 to 12 days, using the /Value assignment parameter:

And finally, another Get-OSUninstallWindow command to confirm that the new window size/rollback interval is in place and correct:

As DISM stuff goes, it doesn’t get much simpler than this.

Gotcha Rears Its Ugly Head

That said, I couldn’t get these commands to work with either the 17663.194 (Version 1803), or the 18292.1000 (Version 19H1). The former emits an Error 3 “The system cannot find the path specified.” The latter emits Error 1168 “Element not found.” I’ve submitted Feedback Hub reports on both of these OSes, and am hopeful that a fix will show up via a cumulative update sooner, rather than later. We’ll see.


Author: Ed Tittel

Ed Tittel is a 30-plus-year computer industry veteran. He’s a Princeton and multiple University of Texas graduate who’s worked in IT since 1981 when he started his first programming job. Over the past three decades he’s also worked as a manager, technical evangelist, consultant, trainer, and an expert witness. See his professional bio for all the details.

Leave a Reply