If you are in the process of restoring your Windows 10 or Windows 11 computer, particularly to sell it or give it to relatives / friends, be careful because some personal data may survive the reset: the bug was recently discovered by the blog Call4Cloudoccurs both in the latest version of Windows 10, 21H2, and in the stable build of Windows 11 (it is unclear if the problem persists even in the first major update of February, whose distribution is just starting), and it only affects files synced with OneDrive.
For some reason, locally available OneDrive folder files survive the reset in a dedicated folder in C: Windows.old (or whatever the letter associated with the boot disk). It is not enough to open File Explorer and go to the folder, but in the initial configuration phase it is possible to launch a command prompt pressing Shift + F10 and, with a little familiarity, reach the files. As we have illustrated there are several conditions and limitations of the bug, but the implications are quite serious – by the way the files end up in the clear even if you had enabled encryption of the entire drive via BitLocker.
The bug occurs with any type of recovery procedure – remotely or locally, with re-download of the installation image or without, even with the option Installation from scratch. The source says that Microsoft is aware of the bug and is preparing a fix. For the moment, the source has always created a quick PowerShell script that deletes any given user in the Windows.old folder; it is recommended to run it at this point. You can download it by clicking on THIS link: it is a .zip file.
If you follow the SOURCE link at the bottom of the article, the author explains in detail what the script does. The alternative is, of course, to perform a clean install of Windows 11, perhaps reinitializing the disk and partitions.