Get/Set “File History” (Windows 8) settings using C#

烈酒焚心 提交于 2019-12-10 22:58:18

问题


I'm creating an app that suppose to run on windows 8 (Desktop)

I need to:

  1. Enable users to launch "File History" using my app. I need to find the command line that opens "File History".

  2. I need to be able to display the current settings of "File History".

I found that the data is saved under "C:\Users\UserName\AppData\Local\Microsoft\Windows\FileHistory\Configuration.

The info is saved in an xml file. I prefer not to parse XML file especially if there is no specification of the exact format. So I wanted to know if there is another place where I can get the "File History" setting information from.

another thing is that for some reason I have there 2 files: config1 and config2. What is the difference between the files? which file contains the more accurate info?


回答1:


I found how to open the "File History" using C#.

ProcessStartInfo startInfo = 
       new ProcessStartInfo("Control.exe",@"/name Microsoft.FileHistory");
startInfo.UseShellExecute = true;
Process.Start(startInfo);

and if you want to get to the "Restore personal files" navigation item, you should launch:

"C:\Windows\System32\FileHistory.exe"



来源:https://stackoverflow.com/questions/10160999/get-set-file-history-windows-8-settings-using-c-sharp

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!