[最新] 如何使用命令提示符 (CMD) 恢復丟失的文件

Last Updated: 2021-12-22

概要In this article, we will walk you through how to recover lost files on Windows 10 using command prompt (CMD) from various storage mediums and the easy-to-use data recovery tool – Bitwar 檔案救援,只需點擊幾下即可取回所需數據。

贏取版本 下載 MAC 版

了解命令提示符 (CMD)

Command Prompt is a handy built-in Windows utility that allows the users to retrieve files lost due to accidental deletion, virus attack, corrupting, and hiding. Using Command Prompt or CMD, you can retrieve files from devices like pen drive, USB, hard disk and memory card, etc. This utility comes pre-installed on Windows devices and absolutely free to use.


  1. 對於初學者來說可能很棘手,因為它需要手動輸入命令行。
  2. 與替代恢復工具相比,功能不那麼強大。
  3. 無法恢復由於復雜情況(例如永久刪除的文件)而丟失的文件。

Nevertheless, the disadvantages come with advantages. Therefore using CMD is an optional solution for some advanced users who would love DIY data recovery to manually recover data from hard disk, USB flash drive, SD memory card, the external hard drive on Windows 10, 8, 7.

We will show you directly how to recover permanently deleted files using CMD on Windows 10 from different locations or partitions. In case you are unable to recover permanently deleted files using Command Prompt (CMD) with the below solutions, there is still an alternative method to recover data by using a data recovery tool so let’s get started now!

如何使用命令提示符 (CMD) 恢復丟失的文件

第 1 部分:USB 驅動器

CMD attrib command is used only to fix how to recover hidden files using CMD. If you see that your files are not in place due to some reason, you can try to use the Attrib command to check if they are hidden somewhere.


第2步: Go to the Start and type 命令在給定的空間或搜索菜單中,然後點擊 進入.

第3步: 你會看到cmd.exe列在程序和右鍵點擊在上面。

第4步: Type the command:attrib -h -r -s /s /d 驅動器號:\*.*在命令窗口中,然後按enter to execute.Command Prompt

注意: Using this command, you should be able to retrieve your virus-deleted files. This command will not work if data is lost due to formatting, partitioning, or files are deleted permanently.

第 2 部分:回收站

Generally, if you send the files to the Recycle Bin by mistake, the files can be recovered by right-clicking on them or using the command line to restore them to their original state or location. What if you are willing to recover deleted files from Recycle Bin? Please follow the steps below:

步驟1: Go to the start and type 命令 in the 搜索再次菜單,然後按enter key.

第2步: After this, select cmd.exe通過在程序列表下右鍵單擊它。

第3步: Type the command: 啟動外殼:RecycleBinFolder and hit 進入.

Recyclebin CMD


第 3 部分:格式化硬盤

Windows 上的命令提示符能夠在重新格式化硬盤驅動器後恢復文件。不過,您必須以管理員身份運行命令提示符並繼續執行以下步驟:

步驟1: Go to the 搜索再次菜單並啟動命令提示符CMD as administrator.

第2步: Type in diskpart並點擊 進入.

第3步: 繼續輸入list diskenter again.

第4步: Type選擇磁盤 Xand tap enter. (將 X 替換為您的磁盤號)

第5步: 最後輸入重新掃描 and tap enter again.

rescan hard disk

Step 6: 耐心等待掃描完成,檢查掃描後文件是否安全恢復。

第 4 部分:RAW 分區或驅動器

Sometimes users may lose their files from an external storage drive after connecting it to the computer due to RAW partition or drive. So all you need to do is to log in using your administrator account and password if it asks for and follows the steps below:

步驟1: Launch the command prompt並輸入命令:chkdsk X: /r/f接著打enter. (用您的驅動器號替換 X。)

command prompt cmd

第2步: 輸入命令磁盤部分並按下enter.

第3步: 然後輸入重新掃描然後按 進入 key.

第4步Exit從 DiskPart 並鍵入命令:chkdsk /f X:在命令提示符下並按Enter. (記得更換X與您的驅動器號,數據丟失的地方。)

Finally, wait for the process to get over and then check if the lost files were recovered or not. In case you are unable to recover lost files using Command Prompts shown above, it’s recommended to use the alternative data recovery tool to get back all the possible data easily and quickly!

替代提示:適用於 Windows 的數據恢復工具

Bitwar Data Recovery software can help you easily and quickly recover no matter the images/photos, documents, videos, audios, archive files, and other files from any storage mediums on Windows 10, 8, 7, or the last macOS. Most importantly, it is capable of recovering the data from various data loss scenarios and offering a simple step-by-step model that is easier to follow than the command prompt. You are much clearer about which mode you can use to recover the wanted files.

此外,所有用戶都可以完全自己動手在Bitwar中進行成功的數據恢復Data Recovery Software如果使用命令提示符恢復丟失的文件最終失敗,只需點擊幾下,幾分鐘:

步驟1: 下載並安裝數據恢復工具Bitwarsoft 下載中心.

第2步: Select the drive劃分從文件被刪除的地方,然後按下一個按鈕。

main interface

第3步: Choose the掃描模式並點擊下一個按鈕。

scan mode

第4步: 選擇 file types你想恢復並按下一個.

file types

第5步Previewselect您需要的文件並單擊恢復 to start the data recovery process.






Command Prompt Attrib is a command line on Windows that allows MS-DOS or users to change the attributes of a file on their computer. Therefore, it can help users to retrieve some of the hidden files on the computer. Besides, it is supported by most of the Command Prompt in all versions of Windows operating systems such as Windows 7, Windows 8, Windows 10, Windows XP, Windows Vista, or other older versions.

什麼是 .chk 文件?

To explain it easier to understand, it is actually fragmented files that are created when any writing process of the file is stopped accidentally in a drive or unexpected shut down of your computer. So, the CHK file is also a file extension for any temporary file format that are existed in Windows, and you can basically call it corrupted data. So users can recover corrupted files using chkdsk command prompt.


  • -H: 命令特定文件的隱藏屬性。
  • -r: 只讀屬性的狀態。
  • -s: 指的是特定文件的系統屬性。
  • /秒: 搜索特定路徑。
  • /d: 表示有由文件夾組成的進程。


Command Prompt (CMD) is a useful feature on the Windows system that allows you to easily o recover lost files. However, this feature is not a guaranteed recovery way when it comes to complex data recovery. Therefore, during such scenarios, you should rely on the powerful data recovery tool – Bitwar 檔案救援從內部或外部設備恢復丟失的數據。



平均評分 5 / 5. 投票數: 1

至今沒有投票! 成為第一個評價這篇文章的人。


如何在 iOS 14 中切換 App Store 帳戶? Summary: In this article, we will walk you through how to recover lost files on Windows 10 using command prompt...


2021 年修復 Windows 資源管理器的最佳方法需要重新啟動 Summary: In this article, we will walk you through how to recover lost files on Windows 10 using command prompt...

關於 Bitwar 數據恢復

3 個步驟從各種數據丟失情況中找回 500 多種已刪除、格式化或丟失的文檔、照片、視頻、音頻、存檔文件。