Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

When trying to run the File History tool in Windows 8 it runs for about 2 seconds then stops. No files are backed up to the selected drive.

In the event viewer the only error that appears is:

Unable to scan user libraries for changes and perform backup of modified files 
for configuration
C:\Users\win8User\AppData\Local\Microsoft\Windows\FileHistory\Configuration\Config

I've tried deleting both the configuration files and the FileHistory directory on the target drive. Setting up File History again results in the same error.

Is there a better way to track down what is causing the failure? Or somehow get the File History tool to create a more verbose log file that shows what is causing the problem?

share|improve this question

Here is what I did. I am not sure that all these steps are necessary, but I just wanted to be sure.

1.

Control panel -> File history -> Advanced Settings -> Open file history event logs and fix/delete all the files that are messing up file history. For me there were a bunch in this folder:

AppData\Local\Microsoft\Windows\WER\ReportArchive\AppCrash_explorer.exe xxxxx

And I deleted them. They didn't look important.

2 . I wrote a quick python script to find any files with non-ascii characters in their names. I manually renamed all of these. This may be why file history fails on some music folders!

import os,string
import sys

validChars='0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ. #^=!()&,_\'-+@%[]{$};`~'

for currdir,folders,filenames in os.walk(r'C:\Users\<username>'):

    //Max filename len on ntfs is 255, but file history adds "F:\FileHistory\<username>\<computer name>\Data" to the front the files and a timestamp to the end so the file really needs to be less than 200 to be safe
    if len(currdir)>200:
        print 200,currdir

    if filter(lambda x: x in validChars, currdir[2:].replace('\\',''))!=currdir[2:].replace('\\',''):
        print 'chars',currdir,

    for filename in filenames:
        if filter(lambda x: x in validChars, filename)!=filename:
            print 'char2',os.path.join(currdir,filename)

EDIT: Don't delete Autodesk Inventor files, it will break autodesk. o_o

3.

File history -> select drive -> (choose your drive) -> (choose your latest backup) -> file history gives some warning about your latest backups not being on this drive. I Clicked OK.

share|improve this answer
    
Same problem for me. As I do not how to run Python scripts (no batch alternative?) I moved all the content one folder after the other to the root of my drive (outside of the library) and after a few minutes the file history works as expected so it hangs on file names or path lengths as you said. The other steps you mentioned were not needed. My file history was empty expect of the error @azl posted in his question. I now will check one subfolder after the other which file caused the problem. Maybe I find out which one caused the problem. – mgutt Apr 12 at 9:13

I adapted the script posted by apple16 above to run in Python 3 and enhanced it a bit. Using a combination of selectively excluding folders from File History and this script to look at possible issues I narrowed down my problem to two files with nearly identical names in the same directory. Both files had the word Espanol in the filename with a tilde over the n. However one had the encoding as: Espan\N{COMBINING TILDE}ol and the other as Espa\N{LATIN SMALL LETTER N WITH TILDE}ol. Both file names listed identically in Windows Explorer with the tilde over the n. When I put these two files in separate folders they are backed up just fine by File History, but when in the same directory they seem to interfere with each other and block File History operation.

Here's the script CheckFileNames.py I used:

#CheckFileNames.py, 10 May 2016, LewisN
#Python 3 version adapted and enhanced by LewisN; based on script by apple16 posted on http://superuser.com/
#Scans Windows file system for potentially problematic directories and files affecting File History operation.
#---------------------------------------------------------------------------------
#SET THE FOLLOWING BEFORE RUNNING:
DirectoryTreeToScan = r'C:\Users\<username>'
DaysBackToList = 0    #Number of days back to list. Set to 0 to list all FLAGGED FILES regardless of file dates.
PrintDates = False    #Set True to show File Creation and Modification dates.

#You may also want to play with the following settings:
flagDirLen=200
flagFullNameLen=200
  # Max filename len on Windows is ~255, but File History adds "F:\FileHistory\<username>\<computer name>\Data" to 
  # the front the files and a timestamp to the end, so backing off on name lengths flagged to be safe.
  # Files with long filenames are actually saved to F:\FileHistory\<username>\<computer name>\Data\$OF and can be
  # retrieved using the File History GUI, but you may want to avoid this.  Also there may be cases where
  # long paths and/or filenames cause errors.

#Notes: 
#  1. Filenames with Unicode characters from various languages are also often ok for File History.  
#     This script exposes these characters so they can be examined for potential problems.
#  2. Filenames with initial dots (also flagged here) are ok for File History (use cmd prompt to edit them).
#---------------------------------------------------------------------------------

import os,string,time,datetime
import sys

validChars="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ. #^=!()&,_'-+@%[]{$};`~"
disallowedChars=r'\/:*?"<>|'
# Note that many other characters are also actually allowed.  Windows expressly disallows \/:*?"<>|    

lastdirheader=''

def PrintDirHeaderIfNeeded():
    global lastdirheader
    if currdir!=lastdirheader:
        print ('===FLAGGED FILES IN DIRECTORY',currdir.encode("ascii","replace").decode()+':')
        lastdirheader = currdir
        return;

def PrintFileDates():
    fname=os.path.join(currdir,filename)
    print('      Created: ' + time.ctime(os.path.getctime(fname)) + ', Modified: ' + time.ctime(os.path.getmtime(fname)))
    return;

def IsRecent(DaysBack):
    fname=os.path.join(currdir,filename)
    if DaysBack==0: return True   # 0 disables limiting file listings based on file dates
    if ((datetime.datetime.now()-datetime.datetime.fromtimestamp(os.path.getctime(fname))).days<DaysBack) or \
       ((datetime.datetime.now()-datetime.datetime.fromtimestamp(os.path.getmtime(fname))).days<DaysBack):
        return True 
    else: return False;

for currdir,folders,filenames in os.walk(DirectoryTreeToScan):

    if len(currdir)>flagDirLen:
        print('===DIRLEN>' + str(flagDirLen) + ':', currdir.encode("ascii","replace").decode())

    if ''.join([x for x in currdir[2:].replace('\\','') if x in validChars])!=currdir[2:].replace('\\',''):
        print('===DIR CHARS+:',currdir.encode("ascii","namereplace").decode())

    for filename in filenames:

        if (len(currdir)+len(filename)>flagFullNameLen) and IsRecent(DaysBackToList):
            PrintDirHeaderIfNeeded()
            print('     FULLNAMELEN>' + str(flagFullNameLen) + ':', filename.encode("ascii","replace").decode())
            if PrintDates: PrintFileDates() 

        if ''.join([x for x in filename if x in validChars])!=filename and IsRecent(DaysBackToList):
            PrintDirHeaderIfNeeded()
            print('     CHARS+:',filename.encode("ascii","namereplace").decode())
            if PrintDates: PrintFileDates() 

        if filename[0:1] == "." and IsRecent(DaysBackToList):
            PrintDirHeaderIfNeeded()
            print('     INITIAL DOT:',filename.encode("ascii","replace").decode())
            if PrintDates: PrintFileDates()

        if any(True for x in filename if x in disallowedChars) and IsRecent(DaysBackToList):
            PrintDirHeaderIfNeeded()
            print('     DISALLOWED (' + disallowedChars + '):',filename.encode("ascii","replace").decode())
            if PrintDates: PrintFileDates()
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.