Windows 10 has a file history/backup feature whereby generations of files in selected folders are archived to a destination folder or drive. See https://support.microsoft.com/en-us/windows/file-history-in-windows-5de0e203-ebae-05ab-db85-d5aa0a199255
Windows has an existing graphical feature to allow the users to review and restore selected archived files.
This application allows the user to list and delete generations of files in an archive folder. The archive folder does not have to be that belonging to the current PC or user. Unlike the Windows feature, it is not restricted to viewing the current user's archive or risking changes to the current archive configuration.
Possible operations are:
- list file generations; can filter files, optionally recurse sub-folders
- delete old file generations; can optionally filter files, keep the last N generations and preview file names before deletion
This application arose as I had several instances of FileHistory backups from several old PCs and users accumulated over time. The goal was to provide a consolidated view of each archive and so reduce the required disc space by deleting older generations of each file.
This is a command line application written in C# for the .net framework version 4.8.
It uses the following nuget packages/files:
Includes unit tests (MSTest).
Command line help is available:
FileHistory --help
show (Default Verb) Show file history files
tidy Tidy old file history files
help Display more information on a specific command.
version Display version information.
The list command is to find and display old generations of matching files in the specified folder:
FileHistory list --help
-h, --hide Hide display of files with only one generation (and no history).
-f, --folder Required. Input folder.
-r, --recurse Recurse sub-folders.
-m, --match Filter using filename wildcard (case insensitive).
-g, --minimumSize Filter to include files greater than minimum size.
-v, --verbose Set output to verbose messages.
--help Display this help screen.
--version Display version information.
The tidy command is to delete old versions of matching files in the specified folder:
FileHistory tidy --help
-p, --preview Preview, do not delete files.
-k, --keepRecentGenerations (Default: 1) Keep the most recent N generations
-f, --folder Required. Input folder.
-r, --recurse Recurse sub-folders.
-m, --match Filter using filename wildcard (case insensitive).
-g, --minimumSize Filter to include files greater than minimum size.
-v, --verbose Set output to verbose messages.
--help Display this help screen.
--version Display version information.
Tested with Windows 10 Professional version 20H2. Includes unit tests.
Enumerates files and folders. Display file name, path and timestamp information. Deletes files.
RedFiveCode (https://github.com/RedFiveCode)
Copyright (c) 2021-2023 RedFiveCode (https://github.com/RedFiveCode) All rights reserved.
Released under MIT License (see License.txt file).
Windows is a trademark of the Microsoft group of companies.