How to Recover Deleted Files with Windows File Recovery CLI

Last update: 26/06/2025
Author Isaac
  • Windows File Recovery is Microsoft's official, free tool for recovering deleted files.
  • Allows you to recover photos, documents, videos and more from hard drives, SSD, USB and memory cards.
  • It includes three recovery modes (Default, Segment, and Signature) for different scenarios and file systems.

Recover files with Windows File Recovery CLI

When faced with accidental file loss in Windows, panic is common. There are situations where the Recycle Bin is not enough and you need a more advanced solution.. That's where the Windows File Recovery tool comes in, a utility officially provided by Microsoft and which, although it may initially intimidate due to its command-line nature, commands (CLI), is a reliable and free option for Windows 10 users and Windows 11.

The Windows File Recovery (winfr) command offers power and flexibility to recover deleted data from hard drives, SSDs, USB drives, SD cards, and virtually any other hard drive. storage local compatible with WindowsIn this comprehensive guide, you'll discover how to install, use, and master the command's different modes and parameters, as well as the scenarios where it really makes a difference, minimizing the risk of losing valuable data.

What is Windows File Recovery and why use it?

Windows File Recovery is an official Microsoft program designed to recover files that no longer appear in the Recycle Bin and that have apparently been lost forever.. Its particularity is that it is managed exclusively by the command line (CLI), which means that does not have a graphical interface and runs through the Windows console (CMD o PowerShell).

This tool is free and can be easily installed from the Microsoft Store, being available for users of Windows 10 version 2004 (build 19041) and later and for Windows 11Its purpose is to allow the recovery of files that have been accidentally deleted, after formatting, due to file system errors, or even in the event of disk failure.

Its strengths include:

  • Supports recovery of multiple file types: images (JPEG, PNG), Office documents and PDF, ZIP compressed files, audio and video files (MP3, MP4, etc.).
  • Supports a wide variety of file systems: NTFS, FAT, exFAT, ReFS.
  • Allows you to restore data on internal and external hard drives, SSDs, USB drives and SD cards.
  • Includes several recovery modes depending on the condition of the unit and the type of loss.

However, its success depends on both the time elapsed since the deletion and whether the files have been overwritten. The sooner you act and the less you have used the drive after deleting the files, the more likely you are to succeed..

Windows File Recovery Installation Process

Before you begin, make sure your system meets the minimum requirements (Windows 10 version 2004 or higher). Installation is simple:

  • Open the Microsoft Store from the start menu.
  • Search for “Windows File Recovery”.
  • Select the tool and click “Get” to download and install it.
  Methods to Add Movies To YouTube From iPhone and iPad

Once installed, you can find it in the Start menu under the name “Windows File Recovery.”

Remember: the tool runs as administrator, so when you open it, it will ask you to confirm permissions.

How Deleted File Recovery Works in Windows (The Basics)

When you delete a file in Windows, it usually goes to the Recycle BinIf you empty the Recycle Bin or permanently delete the file (for example, using Shift+Delete), Windows marks the occupied space as free, but the data does not immediately disappear from the disk.

This means that until that space is overwritten by other data, there are still possibilities of recovering deleted files.Therefore, it is recommended that you stop using the drive immediately after an accidental deletion to prevent overwriting and increase the likelihood of a successful recovery.

Windows File Recovery Modes

A key feature of this tool is its three main recovery modes, each adapted to different scenarios and file systems:

  • Default Mode (Default / Regular): It uses NTFS's own Master File Table (MFT) to search for recently deleted files. It's the fastest and most efficient if you just deleted the file and the drive is NTFS (the default file system in Windows for HDDs and SSDs).
  • Segment Mode (Segment / Extensive): It searches MFT segments and is useful when files were deleted a long time ago or after quick formats. It's slower but can recover more data if the default mode fails.
  • Signature Mode: Scans the disk for recognizable file type signatures (headers and extensions, such as JPG, PNG, DOCX, MP3, ZIP, etc.). This mode is essential if the file system is NOT NTFS (e.g., FAT, exFAT, ReFS) or if the partition is damaged.

Depending on the scenario, it is recommended to try Default mode first, and if it does not recover as expected, switch to Segment or Signature mode..

Supported file systems and limitations

Windows File Recovery covers NTFS, FAT, exFAT, and ReFS file systems.. However, Signature mode is the only one that allows you to recover data in FAT, exFAT and ReFS. So, if you want to recover files from an SD card, flash drive, or external hard drive (which are usually in FAT/exFAT), you'll have to use this method.

Some limitations you should keep in mind:

  • Does not recover data from cloud storage or network shares (OneDrive, Google Drive, etc.).
  • It does not allow you to recover files on the same partition where the originals were.; you must use another destination drive.
  • Doesn't work with overwritten files or when a lot of time has passed and new data has been written over the previously occupied space.
  Complete guide to creating and managing Docker containers

General syntax of the winfr command

The basic structure of the command is:

winfr origin: destination:

Where:

  • origin: drive or disk letter where the deleted files were located.
  • destination: drive or folder where the recovered files will be saved (must be on a different drive).
  • : modifiers or filters to specify file types, paths, patterns, etc.

Each recovery process automatically creates a folder on the destination drive with a name similar to recovery_yyyy-mm-dd_hh-mm-ss.

Main command modifiers and parameters

There are multiple advanced modifiers that allow you to recover files in a precise and customized way. The most important are:

  • /n : allows you to search by file name, path, extension, pattern or wildcards (example: /n *.docx o /n \Users\Pepito\Documents\*).
  • /r : activates Segment mode (deeper than default).
  • /x : activates Signature mode, to analyze supported file types.
  • /and: : Specifies one or more extension groups when using Signature mode (/y:JPEG,PDF,ZIP,…).
  • /p: : saves the recovery log to a different path than the default one.
  • /to : overwrites user requests (useful in scripts or automated processes).
  • /either: : for duplicate file management: always overwrite (a), never (n) or keep both (b).
  • /e : removes the extension filter that WinFR applies by default to certain file types.

There are other more advanced ones like /u (recovers undeleted files, e.g. from the Recycle Bin), /k (restores system files), /g (files without data streams) or /e: (custom extension filters).

Practical examples of using Windows File Recovery

Examples from the documentation and specialized websites demonstrate winfr's versatility. Here are some typical situations:

  • Recover a specific file:
    winfr C: D: /n \Users\username\Documents\report.docx
  • Recover all JPEG and PNG photos from the Pictures folder:
    winfr C: D: /n \Users\username\Images\*.JPEG /n \Users\username\Images\*.PNG
  • Recover all PDF and DOCX files from the entire disk:
    winfr C: D: /r /n *.pdf /n *.docx
  • Recover any file that includes the word invoice in its name:
    winfr C: D: /r /n *invoice*
  • Search only MP3 files in Segment mode:
    winfr C: D: / r / n * .mp3
  • Recover files from a drive FAT32 using Signature mode:
    winfr E: D:\Recovered /x /y:JPEG,PNG
  • List the supported extension groups:
    winfr / #

In each case, replace the paths and drive letters with the corresponding ones on your computer.

Supported file types and extension groups

Signature mode allows you to recover a wide range of file typesThe main groups and their associated extensions are:

  • ASF: wma, wmv, asf
  • JPEG: jpg, jpeg, jpe, jif, jfif, jfi
  • MP3: mp3
  • MPEG: mpeg, mp4, mpg, m4a, m4v, m4b, m4r, mov, 3gp, qt
  • PDF: pdf
  • PNG: png
  • ZIPPER: zip, docx, xlsx, pptx, odt, ods, odp, odg, odi, odf, odc, odm, ott, otg, otp, ots, otc, oti, otf, oth

You can see all supported groups by running winfr / # on the command line.

  MSI Afterburner keeps starting by itself: real causes and how to fix it

Recommendations and good practices for recovery

Act quickly: After an accidental deletion, avoid saving new files to the affected drive and use WinFR as soon as possible.

Always choose a different destination drive than the source drive. to save the recovered files.

If you have any doubts about the mode, start with the Default mode (or Regular). If this doesn't find what you're looking for, try Segment mode, and finally Signature mode, especially on FAT/exFAT or ReFS drives.

On severely damaged or corrupted drives, Signature mode is often the most reliable option.However, very small files (less than 256 KB) may not be recovered correctly in this mode.

For more selective retrieval, use the /n, /yy and pattern modifiers to reduce the number of files recovered and facilitate subsequent identification.

Special cases and advanced scenarios

In addition to standard recovery, WinFR allows some useful options for advanced users or complex situations:

  • Custom records: With /p you can save the log to a specific path for later analysis.
  • Automation and scripts: It incorporates commands such as /ao overwrite options to run bulk or unattended processes.
  • Advanced extension filters: Avoid recovering unnecessary or generic file types using /e or /e: .
  • Restore from Recycle Bin or System Files: The /u and /k parameters allow you to address cases where protected files or files from the operating system itself have been deleted.

Winfr's versatility, combined with a good understanding of switches and how the file structure works in Windows, allows you to maximize your chances of success.

Windows File Recovery Alternatives and Limitations

Although powerful, WinFR is not infallible and may fall short in certain scenarios. For example:

  • If the unit is severely damaged or shows physical failure.
  • When the file system structure has been destroyed or repeatedly low-level formatted.
  • If you need a very visual and user-friendly graphical interface, or more preview options.

In these cases, there are alternative recovery utilities with a graphical interface (such as TestDisk and PhotoRec) that add features such as deep scanning, RAID support, file preview, network recovery, and more file system types (APFS, HFS+, XFS, UFS, EXT, BTRFS, etc.). However, many are paid or limited in the free version.

However, WinFR remains the most direct, secure, and official method for Windows environments, especially in light of recent losses..

Recover deleted files with TestDisk & PhotoRec-3
Related article:
How to recover deleted files with TestDisk and PhotoRec