The 视窗文件恢复 shortcut on a 视窗 10 desktop.

微软’Windows文件恢复是用于从硬盘,SD卡,USB驱动器和其他存储介质中恢复已删除文件的官方工具。这里’有关使用此命令行实用程序的深入分步指南。

What 您 Need to Know

微软’s 视窗文件恢复 tool doesn’t have 图形界面—it’仅是一个命令行实用程序。我们’会告诉你如何使用它,但是它’s a more hands-on process than 您 might expect from an official 微软 utility available in 视窗 10’s Store.

This tool requires 您’ve installed 视窗 10’s May 2020 Update 或Windows 10的较新版本。它没有’不能在Windows的旧版本上运行。

Whether 微软’s tool can actually find 和 recover a file 您’ve删除取决于驱动器。 删除的文件’t立即从硬盘驱动器中卸下, but they often are removed from solid-state drives immediately. 如果你’自从您将大量数据写入SD卡等设备后,’ve删除了文件’该文件可能’的数据可能已被覆盖。

即使您设法恢复文件,也只能得到其中的一部分’s data—the file may be corrupted. 您 can only get whatever data is still on the drive. There are no guarantees here, 和 that’s 为什么备份如此重要.

The utility also has multiple 模式s intended for different situations 和 file systems. We’ll explain which 您 should use 和 how to use them.

How to Install 视窗文件恢复

首先,请安装 the 视窗文件恢复 tool from the 微软 Store to get started. 您 can open the Store 和 search for “Windows文件恢复”或只需单击该链接即可打开商店。

一旦它’已安装,请打开“开始”菜单并搜索“File Recovery.” Launch the “Windows文件恢复”快捷方式一次,然后单击“Yes” to the UAC prompt.

Launching 视窗文件恢复 from the Start menu

您’ll see a Command Prompt window with Administrator access. This is where 您’ll运行文件恢复命令。

您 can use other command-line environments like the 视窗 Terminal 和 PowerShell, but be sure to launch them with Administrator access. (In the Start menu, right-click the one 您 want to use 和 select “以管理员身份运行。”)

winfr命令的命令行帮助。

如何在Windows 10上恢复已删除的文件

To use this tool, 您 will run the winfr command, specifying the drive 您 want to search for the deleted file, the destination 您 want to save it to, 和 the various switches that control what the tool searches for 和 how it searches. 您 must save the deleted file to a different drive.

这里’s the basic format:

winfr source-drive: destination-drive: /switches

运行命令后,该工具将自动创建一个名为“Recovery_ [日期和时间]” on the destination drive 您 specify.

Which Mode Should 您 Use?

在继续之前,您应该确定“mode” 您 want to scan for the deleted file. There are three 模式s, Default, Segment, 和 Signature. Default is the fastest 模式, while Segment is similar but slower 和 more thorough. Signature 模式 can search for files by type—它支持ASF,JPEG,MP3,MPEG,PDF,PNG和ZIP文件。 (搜索“ZIP”文件还将找到以DOCX,XLSX和PPTX等格式存储的Office文档。)

您’我需要知道驱动器是什么文件系统’将被扫描格式化。要找到此文件,请打开“文件资源管理器”,右键单击“此电脑”下的驱动器,然后选择“Properties.” 您’将会看到文件系统上显示的“General” tab.

在Windows 10中检查驱动器的文件系统。

这里’s when 您 should use the different 模式s:

  • Are 您 trying to find a file 您 recently deleted on a drive formatted with NTFS, which is the default 视窗 10 file system? Use Default 模式.
  • 如果你’在另一种情况下重新扫描NTFS驱动器—例如,如果您前一段时间删除了文件,则格式化了驱动器,或者’重新处理损坏的驱动器—try Segment 模式 first 和 then try Signature 模式 afterward.
  • Are 您 trying to find a file stored on a FAT, exFAT, or ReFS drive? Use Signature 模式. The Default 和 Segment 模式s only work on NTFS file systems.

如果你’re in doubt, just start with Default 模式. 您 can then try Segment 和 then Signature if Default 模式 doesn’t work.

如何在默认模式下恢复文件

To use the default 模式, 您 use /n followed by a search path:

  • To search for a file named document.docx, 您’d use /n document.docx . 您 can also specify a full path to the file, such as /n \Users\Bob\Documents\document.docx
  • To search for all files that were in the Documents folder if 您r username is Bob, 您’d use /n \Users\Bob\Documents .
  • To search with a wildcard, use a *. For example /n \Users\Bob\Documents\*.docx will find all DOCX files there were in the Documents folder.

让’s put that all together now. To search for all DOCX files on drive C: 和 copy them to drive D:, 您’d运行以下命令:

winfr C: D: /n *.docx

您 will have to type “y” to continue.

Recovering files with winfr's Default 模式.

如上所述,您’会在名为的目录中找到恢复的文件“Recovery_ [日期和时间]”在您在命令行中指定的目标驱动器上。

Where 视窗文件恢复 puts recovered files.

要查找名称中带有单词的所有文件,请使用通配符。因此,要查找所有带有“project” anywhere in their name, 您’d run:

winfr C: D: /n *project*

您 can specify multiple searches with multiple /n switches. So, to find all Word, Excel, 和 PowerPoint files, 您’d run the following:

winfr C: D: /n *.docx /n *.xlsx /n *.pptx

要搜索位于驱动器C上\ Users \ Bob \ Documents文件夹中的名为Important_document.pdf的特定文件,请执行以下操作:—然后将其保存到驱动器D:—you’d use:

winfr C: D: /n \Users\Bob\Documents\important_document.pdf

如何在分段模式下恢复文件

Segment 模式 works almost exactly like Default 模式. To use segment 模式, which examines file record segments, 您 use /r in addition to /n .

In other words, 您 can construct Segment 模式 recovery commands in the same way 您 construct Default 模式 commands—just add the /r .

For example, to recover all deleted MP3 files from 您r C: drive 和 save them to 您r D: drive, 您’d run:

winfr C: D: /r /n *.mp3

So, if a Default 模式 search doesn’t find what 您’re looking for, add the /r 和 try again.

Running winfr in Segment 模式 in Command Prompt.

如何在签名模式下恢复文件

Signature 模式 works a bit differently. It examines file types, so it can only find deleted files of certain file types. To use Signature 模式, 您 use /x to specify Signature 模式 和 /y: to list the file type groups 您’d想搜索。

这里’s支持的文件类型及其组的列表’re sorted into, taken from 微软’s documentation:

  • 美国空军: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
  • 压缩:zip,docx,xl​​sx,pptx,odt,ods,odp,odg,odi,odf,odc,odm,ott,otg,otp,ots,otc,oti,otf,oth

请注意“ZIP” group includes 压缩 files in addition to 微软 办公室 和 OpenDocument documents.

您 can pull up this list at any time by running the following command:

winfr /#

在命令提示符中显示有关winfr的文件扩展名组的信息。

让’s say 您 want to search drive E: for images in JPEG格式 format 和 save them to drive D:. 您’d运行以下命令:

winfr E: D: /x /y:JPEG

您 can specify multiple file groups by separating them with a space. So, if 您 want to find JPEG格式 files, PDF格式s, 和 Word documents, 您’d run:

winfr E: D: /x /y:JPEG,PDF,ZIP

Recovering files with winfr's Signature 模式.

winfr的更多帮助

有关更多信息,请参见 微软’s official winfr documentation page. 您’ll find a detailed list of all winfr ‘该页面上的s命令行选项。

For a refresher on the basics, just run winfr or winfr /? .

There are also additional advanced options 您 can see by running winfr /! .

winfr命令的高级选项。

克里斯·霍夫曼 克里斯·霍夫曼
克里斯·霍夫曼(Chris Hoffman)是《 如何极客》首席编辑。他撰写了近十年的技术文章,并担任PCWorld专栏作家两年。克里斯曾为《纽约时报》撰稿,曾在迈阿密NBC 6等电视台接受过技术专家的采访,而他的工作也被BBC等新闻媒体报道。自2011年以来,克里斯撰写了2000多篇文章,被阅读了超过5亿次-而这就是How-To Geek的内容。
阅读完整的传记»

x

最好的技术通讯随处可见

加入 350,000位订阅者 并每天获取新闻,漫画,琐事,评论等的摘要。