[German]In Windows 10 and Windows 11, there is an issue with certain builds when resetting the operating system. Even if the option to delete all files with was selected, these (user) files remain under certain scenarios – if OneDrive was used. I had recently addressed this in a blog post. Now Microsoft has confirmed this bug for various versions of Windows 10 as well as for Windows 11.
The user folder wipe issue when resetting
Windows 10 and Windows 11 offer the option to reset the operating system locally or remotely (via MDM like Intune). There is also the option to have the user files removed as well. In the blog post Windows 10/11 (21H2): Wipe does not delete user data from February 21, 2022 I had reported that the removal of user files during a Windows reset does not work in certain scenarios.
These files remain in Windows.old when OneDrive is used. This poses a problem when personal files are to be removed from the system by resetting. Dutch MVP Rudy Ooms came across this issue and immediately provided a corresponding PowerShell script to clean up the reset system.
Microsoft confirms the issue
An anonymous blog reader alerted me in this comment that Microsoft has confirmed this issue as of February 24, 2022 in the Windows Status section.
Files might persist after resetting a Windows device
When attempting to reset a Windows device with apps which have folders with reparse data, such as OneDrive or OneDrive for Business, files which have been downloaded or synced locally from OneDrive might not be deleted when selecting the "Remove everything" option.
This issue might be encountered when attempting a manual reset initiated within Windows or a remote reset. Remote resets might be initiated from Mobile Device Management (MDM) or other management applications, such as Microsoft Intune or third-party tools. OneDrive files which are "cloud only" or have not been downloaded or opened on the device are not affected and will not persist, as the files are not downloaded or synced locally.
Note: Some device manufacturers and some documentation might call the feature to reset your device, "Push Button Reset", "PBR", "Reset This PC", "Reset PC", or "Fresh Start".
However, this is the behavior I described in the blog post above, which was observed by Rudy Ooms on a customer system. The following Windows clients are affected by this problem:
- Windows 11, version 21H2
- Windows 10, version 21H2
- Windows 10, version 21H1
- Windows 10, version 20H2
Microsoft is working on a solution and plans to release it for one of the upcoming versions. To mitigate this problem, Microsoft suggests the following:
- The issue can be prevented by logging out of OneDrive or unlinking OneDrive in the section before resetting your Windows device. For instructions, see Turn off, disable, or uninstall OneDrive.
- Alternatively, the issue can be resolved on devices that have already been reset by following the steps in KB5012334—Delete the Windows.old folder using Storage sense in the Settings app.
For people resetting clients remotely via Intune or other MDM management solutions, I refer you to the blog post THE DARK AND THE WINDOWS "REMOTE/LOCAL" WIPE by Rudy Ooms, which provides a PowerShell script RemoveWindowsold.zip to delete the file Windows.old.
Windows 10/11 (21H2): Wipe does not delete user data
Windows 10 20H2: January 2022 Updates breaks AGPM-Server
Microsoft Security Update Revisions: Windows Vulnerability CVE-2021-26414 (Feb. 24, 2022)
Cookies helps to fund this blog: Cookie settings