tl;dr: Is there a way to configure windows 8 file history via unattended command-line/some script?
long story: I'm configuring a lot of stand-alone (non-domain) PCs and I think some backup is better than no backup. On Windows 7, I even configure its standard backup, despite it's retarded – by default it significantly slows computer every Monday, unless by some obscure reason user didn't turn off their PC before weekend, and it fills backup medium and stops backing up.
And I resigned to try to automate its configuration, but at least there I can set it up once as admin, and it's effective for all, including new, users. And I'm scheduling (scheduling is automated) custom script to remove old backups when backup media is low on space, so it's does not require maintenance afterwards (set once and forget).
Since Windows 8, there is this thingy called File History, which is a lot less intrusive for users (it's performance impact is barely noticeable), and it can clean up for itself (automatic history management based on age or free space). It's real back up solution, for real now :) But it also requires manual configuration for each user. Which is not acceptable, as users will forget to configure it.
My plan is to configure it per-user using some runonce logon script. I'm already doing some things via runonce-logon scripts, so installing such a script is not a problem. But I don't know how to configure File History via a script.
I tried some research, but the only official (there are some unofficial findings, see below screenshots) related tool I found is FhManagew.exe, which removes old file versions. And I need to set it up via GUI first. On the link, there is complete API, and seemingly File History can be configured via that API. But I assume this is API for .NET apps, so it can't be used via command line. Or can it?
Tried registry search, but file history location is not found anywhere :(
For specifics, let's say I want to set up file history to
\\localhost\FileHistory$ and to keep file version until free space needed (by default it keeps forever). Here's how it should look:
For reference: backup to local share is workaround to make File History work on single HDD, otherwise it claims it's unsafe.
Here is what I found via comments: configuration is stored in xml files in
%LocalAppData%\Microsoft\Windows\FileHistory\Configuration. It's referenced in registry key
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\fhsvc\Parameters\Configs with value name = path to configuration folder (as above), and value data =
But simply adding these files and registry values and starting the service (there's script for it) does not start backups, neither configuration gets updated in Control Panel. However if File History is configured already, updates to xml files get reflected in control panel.