Manage Learn to apply best practices and optimize your operations.

OSUninstallWindow DISM Difficulties

Drat! I really like the built-in Windows 10 Deployment Image Servicing and Management (DISM) command. But I’ve discovered some DISM schisms. They embrace Version 1809 (Build 17633.134) and the Insider Preview (Build 18298.1000). Usually, DISM supports get and set operations for something called OSUninstallWindow. This describes the command’s ability to query (get) the number of days the OS will keep a previous version around after an upgrade. There’s also a corresponding command to change that number (set). Right now, neither will run with current Win10 versions. That leads me to claim OSUninstallWindow DISM difficulties.

Detecting OSUninstallWindow DISM Difficulties

It’s pretty easy to tell these commands don’t work as they should. On Version 1809, they throw “Error 3: The system cannot find the path specified.” On Version 19H1 (Build 12298), they throw “Error 1168: Element not found.” I’ve reported this to the Windows 10 Feedback Hub under the title “dism /online /get-osuninstallwindow not working.” I hope you’ll check the status on your Windows 10 PCs and upvote this item if you experience the same errors. I’ve checked all 9 PCs here at Chez Tittel, and all are subject to these errors. [As explained in the concluding section below, these errors will present on any PC where Windows.old has already been cleaned out.]

Here’s an illustration from a 19H1 Insider Preview test machine. It shows proper syntax for both commands in an admin PowerShell session. You can run them in an Administrative Command Prompt window, if you prefer.

OSUninstallWindow DISM Difficulties.error

Something, somewhere is going sideways with this usually ho-hum, dead easy DISM command sequence.

At present, default value for the OSUninstallWindow is 10. In fact, that means ten days. Thus, on Day 11 after you upgrade Windows 10, it fires off a disk cleanup task that gets rid of Windows.old and other leftovers from an upgrade install. When the aforementioned DISM command (Set-OSUninstallUpgrade) is working, that’s easy to change. But for the time being, it’s stuck at 10 days. You’ve been warned!

Again: check your PCs. If one of these errors pops up for you, please upvote my Feedback Hub item. Look for “dism /online /get-osuninstallwindow not working.” Thanks in advance for your help and support!

Explanation for the Errors

Having now spent a bit more time researching this matter, and working with my friend and business partner Kari Finn, I’ve got it figured out. These DISM commands work only if a Windows.old folder is present on the system drive. The retention info is apparently stored within that folder structure. If it’s not around, you can neither get nor set the value for OSUninstallWindow. How do I know? Because when those commands run on a Windows 10 install with Windows.old present, they work as advertised. When Windows.old is absent, either the path is missing or the item is absent depending on Win10 version.

I disagree with Microsoft’s implementation. To my way of thinking, right or wrong, the retention interval is an abstract value. Users should be able to set it whether Windows.old is present or absent. But that’s not how Microsoft handles the OSUninstallWindow. Thus, I’m changing my feedback hub request to ask them to turn it into a Group Policy or a Registry setting. It shouldn’t depend on the presence or absence of a specific folder hierarchy. ‘Nuff said.

Join the conversation

1 comment

Send me notifications when other members comment.

Please create a username to comment.

Great info