How to Cleanup Older File History Backups in Windows 10

File History does point in time backups of your files so that you can revert back to the exact copy or version of your files when you need them. Although File History allows you to configure how long the backups are retained, however, it doesn’t seem to clear the older versions of the files automatically.

File History doesn’t automatically clear older versions of the files despite choosing an option in the Keep saved versions: dropdown. You can see that in the following screenshot.

file history does not clean older versions automatically

I have configured File History to retain the versions stored within the last one month. However, the File History store shows much older versions of files are intact. The automatic cleanup is not working, and we don’t know if it’s by design or not. Or is it possible that the older versions are purged automatically when the hard disk becomes full? We’re not sure. Windows doesn’t seem to have a task that triggers the cleanup the older File History versions.

This post tells you how to clean up older versions of your File History backups using two different ways: using the File History GUI or command-line. The command-line can also be automated using Task Scheduler.

How to Cleanup Older File History Backups in Windows 10

Follow any of these methods to clean up older versions of File History backups on your Windows 10 computer.

Method 1: Using File History Settings

  1. Click Start, type Control Panel, and click Control Panel from the search results.
  2. Set Control Panel to icons view, and click File History
  3. Click Advanced Settings in the Tasks pane.
    How to Cleanup Older File History Backups in Windows 10
  4. In this screen, you can configure the frequency of backups, and how long the backups are stored. To delete older versions from the File History backup, click Clean up versionsHow to Cleanup Older File History Backups in Windows 10
  5. Select one of the following options in the drop-down, and click Clean up.
    • All but the latest one
    • Older than 1 month
    • Older than 3 months
    • Older than 6 months
    • Older than 9 months
    • Older than 1 year (default)
    • Older than 2 years

    How to Cleanup Older File History Backups in Windows 10

Method 2: Using Command Prompt

To clear older versions of file history backups, there is also a command-line tool named fhmanagew.exe. FhManagew.exe deletes file versions that exceed a specified age from the currently assigned File History target device.

For instance, to delete all file history backup versions that are older than 45 days, open a Command Prompt window and type:

FhManagew.exe -cleanup 45

How to Cleanup Older File History Backups in Windows 10

file history clean up old versions

Note: If no files match the age criteria you specified (files older than 45 days), the following message would appear.

We didn’t find any versions of your files that were that old
Choose a shorter period of time and try again.

The command-line tool supports the -quiet parameter which suppresses output message(s) and the dialog shown above. To do the clean up silently, you’d use:

FhManagew.exe -cleanup 45 -quiet

That’s it! Backup copies older than 45 days are removed. The oldest backup dates back to May 29 now.



file history clean older versions - fhmanagew.exe

file history clean older versions - fhmanagew.exe
File History folder size (before cleanup)
file history clean older versions - fhmanagew.exe
File History folder size (after cleanup)

Additional Tips

In addition to the above -cleanup switch, FhManageW.exe supports the following switches which aren’t officially documented.

Run File History backup on demand, manually.

FhManageW -backupnow

Stop File History backup that’s currently running

FhManageW -stop

Open File History settings page:

FhManageW -autoplay

Checks (Error checking) the drive assigned as the File History backup drive:

FhManageW -checktarget

Using FhManageW with Task Scheduler

You can automatically clear older versions of File History backups using Task Scheduler.

  1. Open Task Scheduler, and click Create Task
  2. Assign a name and description for the task — e.g. Clear Old File History Backups
  3. Select the Triggers tab, and click New.
  4. In the Begin the task: On a Schedule will be the default selection.
  5. Select the frequency you want the task to run: Weekly, Daily, or Monthly. You may choose Weekly, and select the day(s) you want the task to run. Multiple choices are allowed.
  6. Click OK, select the Actions tab, and click New.
  7. In the Program/Script text box, type c:\windows\system32\fhmanagew.exe
  8. In the Add arguments: type -cleanup 45 -quiet
    (The above command-line clears file history versions older than 45 days.)
  9. Click Ok, and select the Settings tab.
  10. Enable Run task as soon as possible after a scheduled start is missed
    file history older versions cleanup fhmanagew scheduled task
  11. Click OK.

Hope the scheduled task method plugs the shortcoming of the File History tool and helps save disk space by regularly purging the older versions of your files.


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.

4 thoughts on “How to Cleanup Older File History Backups in Windows 10”

  1. Is there a way to retain just the 3 most recent versions of a file, regardless of when they were last saved? If I choose to delete files older than 3 months, and there is only one version of a file (and IT is older than 3 months), is that one version kept even though it is older than 3 months? Thanks.

    Reply
    • @MG: I don’t know how to set about keeping the latest 3 versions, but I think I can reassure you that at least one version will remain.

      The dialogue in File History Clean-up says:
      “The clean-up deletes versions of files and folders older than the selected age, except the most recent version of a file or folder.
      All other files and folders, such as versions that were excluded or removed from your libraries, are also deleted.”

      So that looks as though any file which File History has backed up will have at least its most recent version preserved, even if it’s older than the age you chose.

      But I can’t tell from that whether a file such as the following would have ALL its versions deleted:
      a file, in one of your libraries that File History already backs up, that is older than your chosen age but which you have since deleted from that library.

      I guess the answer would be to create such a file in a new library, let File History create several versions, then delete it from your library and see what Clean-up does to it. Would that answer your question?

      [edited by admin — merged the addition comment into this.]

  2. I backup files in appdata, because of some pop3 and local email accounts. The multiple copies of these large files consumes massive space. If I Manually delete those files from the file history folder, will there be any ill effects (other than not being able to restore the specific file from particular date)?

    Reply

Leave a Comment