How does Windows know which files to keep during reset

So today I was doing a system reset on a Windows 10 virtual machine. I got the option to either keep my own files or delete everything. This made me wonder the following: How does Windows know which files are for Windows itself and what to delete? I was thinking of the following:

  • Each "Windows file" has a property that tells the OS during reset to not delete that file
  • Windows has a copy of an original Windows version which replaces the old files

I don't know if either one of these two options is right, but the first doesn't seem reasonable to me for some reason, and the second option would mean that the size of Windows is always the size of at least two Windows OS's . How does this work?


Solution 1:

How does Windows know which files are for Windows itself and what to delete?

Windows will keep those files located within a user's profile directory.

I was thinking of the following:

  • Each "Windows file" has a property that tells the OS during reset to not delete that file
  • Windows has a copy of an original Windows version which replaces the old files

A system file does not have a property that tells the OS not to delete the file. The files used by Reset are contained within a .wim image. The files used by Refresh are downloaded by the tool you use.

How does this work?

User's files are moved to a location other then the system drive, Windows is installed again, then the user's files are returned to their correct location. Reset does not wipe the registry. Refresh does a complete reinstall of Windows.

The folder C:\Windows.OLD is used to store Program Files.