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.
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.
Cleanup Older versions of File History backups
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.
- Click Start, type Control Panel, and click Control Panel from the search results.
- Set Control Panel to icons view, and click File History
- Click Advanced Settings in the Tasks pane.
- 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 versions
- 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
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
Note: If no files match the age criteria you specified (files older than 45 days), the following message would appear.
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.
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.
Stop File History backup that’s currently running
Open File History settings page:
Checks (Error checking) the drive assigned as the File History backup drive:
You can automatically clear older versions of File History backups using Task Scheduler.
- Open Task Scheduler, and click Create Task
- Assign a name and description for the task — e.g. Clear Old File History Backups
- Select the Triggers tab, and click New.
- In the Begin the task: On a Schedule will be the default selection.
- 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.
- Click OK, select the Actions tab, and click New.
- In the Program/Script text box, type
- In the Add arguments: type
-cleanup 45 -quiet
(The above command-line clears file history versions older than 45 days.)
- Click Ok, and select the Settings tab.
- Enable Run task as soon as possible after a scheduled start is missed
- 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!
About the author
Ramesh Srinivasan founded Winhelponline.com back in 2005. He is passionate about Microsoft technologies and he has been a Microsoft Most Valuable Professional (MVP) for 10 consecutive years from 2003 to 2012.