How can I access Windows 8 File History programmatically?

I have several thousand image files that were corrupted by some kind of rogue process on my machine. I have .NET code to detect broken files. I would like to list and access previous versions of these files (Windows 8 History History enabled) and restore working versions.

I found this page with information on how to configure the history of files in the code, but nothing on how to access previous versions in the code . Is there a simple API for this ?

+6
source share
2 answers

In the end, I would not notice the obvious. With file history, backups are written to a custom location. I checked my file drive and found a directory structure that mirrors my source disk. There are several versions of each backup file, each of which has a date and time suffix. for example mytextfile.txt has several versions with names like mytextfile (2013_05_15 10_22_00 UTC).txt .

It was easy to match source files with backups using a simple regular expression. Optional Win API calls are not required.

I'm still curious to know for future reference if there is a more “scientific” way to do this.

+3
source

Sample found here: FileHistory example

+1
source

Source: https://habr.com/ru/post/947247/


All Articles