When you've emptied the Recycle Bin, formatted the wrong memory card or lost files from a corrupted USB stick, two free tools come up again and again. Windows File Recovery is Microsoft's own command-line app, and PhotoRec is the long-running open-source recovery tool from CGSecurity, the makers of TestDisk. Both can bring back deleted files, but they work in different ways and suit different situations. This comparison uses Microsoft's and CGSecurity's documentation as of 29 November 2026.
Whichever you use, stop writing to the drive that lost the files. Microsoft explains that when a file is deleted, Windows marks its space as free, so the data can still exist, but any use of the computer can create files that overwrite that free space at any time. CGSecurity says the same: as soon as you notice a missing file, don't save anything more to that drive, and don't recover files onto the same partition they came from. Windows File Recovery goes further and refuses to run if the source and destination are the same partition.
So before you start, have a second drive ready for the recovered files. An external SSD such as the Samsung Portable SSD T7 Shield 1TB or Crucial X10 1TB works, as does any internal drive or USB stick that isn't the one you're recovering from.
At a glance
| Windows File Recovery | PhotoRec |
|---|
Made by | Microsoft | CGSecurity (Christophe Grenier), open source under GPL v2+ |
Get it from | Microsoft Store | CGSecurity download page (portable, no installer) |
Runs on | Windows 11 and Windows 10 | Windows, Linux, macOS, BSD, DOS and more |
Interface | Command line (winfr command) | Text-mode menus |
How it finds files | NTFS modes use the master file table or file record segments; signature mode uses file headers | Ignores the file system and searches for file signatures |
File names and folders | Can search by file name, folder path and wildcard with /n | Original names generally lost; files are written to recup_dir folders |
Supported file systems | NTFS in Regular mode; FAT, exFAT and others in Extensive mode only | At least FAT, NTFS, exFAT, ext2/3/4 and HFS+ |
Cloud and network drives | Not supported | Works on local disks, memory cards and disk images |
Best for | Recently deleted files on an NTFS drive | Formatted or corrupted media, memory cards, non-Windows drives |
How Windows File Recovery works
Windows File Recovery is a command-line app from the Microsoft Store. Microsoft says it's for files deleted from local storage, including internal drives, external drives and USB devices, that can't be restored from the Recycle Bin. Recovery from cloud storage and network file shares isn't supported.
You open it from Start, allow it to make changes to your device, and type commands in the Command Prompt window it opens, in this format:
winfr source-drive: destination-drive: [/mode] [/switches]
There are two basic modes:
Regular is the standard option for non-corrupted NTFS drives. Microsoft recommends it for NTFS files deleted recently.
Extensive is a thorough mode suitable for all file systems. Microsoft recommends it for NTFS files deleted a while ago, after formatting, on a corrupted disk, and for any FAT or exFAT drive. Recovering from non-NTFS file systems is only supported in this mode.
The /n filter is what makes it practical. Microsoft's examples include recovering your Documents folder with winfr C: E: /regular /n \Users\<username>\Documents\ and recovering PDF and Word files with winfr C: E: /regular /n *.pdf /n *.docx. When recovering from the Windows drive, Microsoft says to use /n filters to target user files, because Windows constantly creates and deletes files of its own. The tool also filters a long list of system and code file types by default, which you can switch off with /e.
Recovered files go into a folder called Recovery_ followed by the date and time on the destination drive. If you're not sure which mode to use, Microsoft says start with Regular, then try Extensive if that fails.
For advanced users there are also NTFS, segment and signature modes, and /y: lets signature mode target specific groups of file types.
Where it falls short: there's no graphical interface, the syntax is fussy (drive letters need colons, folder paths need a trailing backslash), and it only runs on Windows 10 and 11. Source and destination must both be given as drive letters.
How PhotoRec works
PhotoRec takes a different approach. CGSecurity says it ignores the file system and goes after the underlying data, so it still works when the file system has been severely damaged or the media reformatted. It reads the drive block by block and checks each block against a signature database; for example, it recognises a JPEG from the bytes at the start of a block. CGSecurity says it recognises more than 480 file extensions in about 300 file families, including ZIP, Office documents, PDF, HTML and JPEG.
It's built to be safe: PhotoRec uses read-only access to the drive or card you're recovering from. It runs on Windows, Linux, macOS and more, and works with hard drives, SSDs, memory cards (SD, CompactFlash and others), USB drives and disk images.
The process is menu-driven. You run photorec_win.exe as administrator, choose the disk and partition, optionally pick file types in File Opt, choose the file system type (Other unless it's ext2/3/4), then decide whether to search the whole partition or only unallocated space, which recovers only deleted files. Finally, you choose a destination folder. Recovered files land in recup_dir.1, recup_dir.2 and so on, and you can browse them while the scan runs.
Where it falls short: CGSecurity explains that deleting a file loses its metadata, including its name, and suggests trying TestDisk first when you need the original file names, so expect to sort through renamed files afterwards. CGSecurity suggests sorting the results by extension or date, and notes that PhotoRec sets modification times from file metadata when it's available. Heavily fragmented files may not come back whole, and CGSecurity notes it doesn't work well with ReiserFS. It also recommends scanning recovered files for viruses before opening them.
Which should you use?
Choose Windows File Recovery if you've deleted files recently from an NTFS drive in a Windows 10 or 11 PC, such as a Documents folder you emptied from the Recycle Bin. Regular mode with a /n filter lets you target exactly the folders and file types you lost, rather than wading through everything on the disk.
Choose PhotoRec if the drive was formatted, the file system is corrupted, the drive is a camera card or USB stick formatted as FAT or exFAT, or you need to work from Linux or a Mac. Its signature search doesn't depend on the file system being intact.
Try TestDisk first if a whole partition has disappeared or shows as RAW. CGSecurity's own advice is that for lost partitions, or deleted files on FAT or NTFS, TestDisk is usually faster and can recover the original file names.
It's also reasonable to try both: Windows File Recovery's Regular mode first for a targeted search, then PhotoRec for whatever is still missing, always writing to a different drive. Neither can bring back data that has already been overwritten, and Microsoft warns that's more likely on a solid-state drive.
For a wider look at the options, see our best free data recovery software roundup. And once your files are safe, set up Windows Backup or a folder backup with FreeFileSync so you don't need either tool again.