[Fix] File History “The parameter is incorrect” Error

File History may have been working all these years correctly. But, of late, you may have noticed that File History backups stopped working even though the File History settings page says the feature is turned on.

To make it work again, users may attempt to clean up old versions of File History backups to free up the disk space. However, doing so may cause the error “The parameter is incorrect.” Here’s the full error message verbatim:

File History Cleanup

Could not clean up File History data

The parameter is incorrect.

file history not working - element not found error

The Event Viewer may show the following entry for each failed File History Backup attempt:

Log Name: Microsoft-Windows-FileHistory-Engine/BackupLog
Source: Microsoft-Windows-FileHistory-Core
Date: 1/21/2022 12:41:49 PM
Event ID: 200
Task Category: None
Level: Error
Keywords: 
User: SYSTEM
Computer: OptiPlex-9020
Description:
Unable to start a backup cycle for configuration C:\Users\Ramesh\AppData\Local\Microsoft\Windows\FileHistory\Configuration\Config

file history not working - element not found error

Also, when you attempt to view or restore the previously backed up File History data, the page may show the message “No file history was found” and suggests that the user clicks on the “Configure File History settings link”. This may happen even though the data is still intact in the File History storage drive.

file history not working - element not found error

In some cases, the File History applet in the Control Panel may show “Unknown error” and “File History doesn’t recognize this drive”.

file history not working - element not found error

Cause

The File History backup failure (and the “The parameter is incorrect” error) is caused by the incorrect data in the File History configuration (config1.xml and config2.xml) file(s).

For instance, if you rename your computer, the File History configuration would still reference the old computer name. This blocks the File History application from querying the File History configuration. Thus, the user will be unable to view or restore the previously backed up data, although the files are intact in the File History storage drive.



Fix File History “The parameter is incorrect” Error

You can fix the File History error “The parameter is incorrect” by renaming the File History configuration XML files config1.xml or config2.xml. Alternately, you can fix the contents of the XML file(s) manually (preferred option) so that your earlier File History customizations are preserved.

Step 1: Update the Configuration File

If you’ve renamed your computer earlier, edit the File History configuration files using Notepad and update the computer name accordingly in the XML file.

Note: If you have NOT renamed the computer and yet the “The parameter is incorrect” error occurs, follow the steps listed under the “Still does not work” section in this article.

  1. Open File Explorer and navigate to this folder:
    %LocalAppData%\Microsoft\Windows\FileHistory\Configuration

    (Copy the above path and paste it in Explorer address bar and hit Enter)

  2. Rename the file named Config2.xml to Config2-old.xml
  3. Open the file Config1.xml using Notepad.
  4. Update the computer name in the XML file.
    file history not working - element not found error

    Around six months back, I renamed my computer to OptiPlex-9020 from the previous name DESKTOP-JKJ4G5Q and that’s when File History stopped working. All I had to do was change the <PCName> data accordingly in the XML file.
    <?xml version="1.0" encoding="UTF-8"?>
    <DataProtectionUserConfig SchemaVersion="1">
    <UserName>ramesh</UserName>
    <FriendlyName>Ramesh Srinivasan</FriendlyName>
    <PCName>DESKTOP-JKJ4G5Q</PCName>
    
    to the following:
    
    <?xml version="1.0" encoding="UTF-8"?>
    <DataProtectionUserConfig SchemaVersion="1">
    <UserName>ramesh</UserName>
    <FriendlyName>Ramesh Srinivasan</FriendlyName>
    <PCName>OptiPlex-9020</PCName>
    Hint: To quickly find your computer name, open a Command Prompt window and type the command “hostname“. Alternately, press the WinKey + Pause|Break key to open the About page in the Settings dialog directly. It shows the name (“device name”) of your computer.
  5. Delete the line that starts with the tag <UserId> line. This is important!
    file history not working - element not found error
  6. Save the XML file and close Notepad.

Step 2: Reconfigure File History

  1. Launch the Services MMC console by running services.msc via the Start/Run dialog.
  2. Right-click “File History Service” and click Restart.
    file history not working - element not found error
  3. Close the Services console.
  4. Now, open the File History page in the Control Panel to reconfigure File History.
  5. Click on the “Turn on” button.
  6. Enable the checkbox “I want to use a previous backup on this File History drive” if you need access to the previously backed up data. Of course, this assumes that you’re still using the same drive for File History backup and got it connected already.
    file history not working - element not found error
  7. Select the existing backup from the list. Don’t bother even if it shows the old computer name in that list view box below.
  8. Once done, click on the “Advanced settings” link in the left pane.
  9. Select the “Save copies of files” and “Keep saved versions” options accordingly.
    (If you need to clean up older versions of File History data, you can do so. You should no longer see the “The parameter is incorrect” error now.)

    file history not working - element not found error

  10. Click on the Save changes button.

Still doesn’t work?

If updating the computer name in the Config1.xml manually doesn’t work, then follow these steps:

  1. Rename the files config1.xml and config2.xml.
    file history not working - element not found error
  2. Restart File History Service via the Services MMC.
    Now, File History will regenerate fresh copies of Config1.xml and Config2.xml (which is a replica of Config1.xml). However, your customizations, such as the “excluded folders” list, backup retention period  (days/months/years) data, are lost. You’ll need to reconfigure the File History Backup options via Settings → Update & Security → Backup → Backup using File History → More options.

    file history not working - element not found error

  3. Reconfigure File History Backup Options (Include/Exclude folders/Backup retention) via Settings.
  4. If you need to change the storage device, you need to reconfigure File History via Control Panel.

The File History backup feature on your computer should be good to go!

file history not working - element not found error

And yes, as you can see above, you should be able to view or restore your older File History backups as well.


One small request: If you liked this post, please share this?

One "tiny" share from you would seriously help a lot with the growth of this blog. Some great suggestions:
  • Pin it!
  • Share it to your favorite blog + Facebook, Reddit
  • Tweet it!
So thank you so much for your support, my reader. It won't take more than 10 seconds of your time. The share buttons are right below. :)

Ramesh Srinivasan is passionate about Microsoft technologies and he has been a consecutive ten-time recipient of the Microsoft Most Valuable Professional award in the Windows Shell/Desktop Experience category, from 2003 to 2012. He loves to troubleshoot and write about Windows. Ramesh founded Winhelponline.com in 2005.

Leave a Comment