「嗨。我的筆記型電腦有時運行緩慢。啟動需要一分鐘,有時會在網頁上凍結。當我嘗試關閉頁面時,它不會立即關閉。我知道我有我遇到的問題是如何辨識並刪除正確的重複檔案/資料夾,有人可以幫我解決這個問題嗎? 如果您的 Windows 電腦上有多個重複的資料夾/檔案並且想要刪除這些重複項,使用命令可能是一個不錯的選擇。本文將向您展示如何使用 cmd 在 Windows 10 中尋找和刪除重複文件,以釋放並加快您的筆記型電腦/PC 的速度。
第 1 部分:在命令提示字元中使用 CMD 尋找並刪除重複檔案
,然後在搜尋欄中輸入 cmd。接下來,右鍵單擊命令提示字元上的 並以管理員身份執行它。然後按照以下步驟操作。 如何使用cmd查找重複文件
步驟 1:在命令提示字元視窗中,輸入Enter。 在輸入指令之前,找到要掃描重複檔案的資料夾並複製檔案路徑。然後將 資料夾路徑 替換為複製的檔案路徑。
第 3 步:輸入 dir /s /b *.extension
並按Enter。 然後你會發現命令視窗中列出了重複的檔案。在輸入命令之前,將 extension 替換為您要尋找的重複檔案的副檔名。
如何使用cmd刪除重複檔案
值得注意的是,如果您使用 del 命令刪除重複的文件,這些文件將從您的磁碟中刪除,並且無法從回收站中檢索。現在,請按照以下步驟操作。第2步:輸入
del“* – Copy.png”
並按Enter。 在輸入命令之前將-Copy.png更改為真實檔案後綴和副檔名。例如,如果要刪除後綴和副檔名為-1.txt的重複文件,則需要輸入del“* – 1.txt”
之後,您就可以成功刪除那些不需要的相同副檔名的重複檔案了。
2.在 PowerShell 中使用 CMD 尋找並刪除重複檔案除了命令提示字元之外,Windows PowerShell 還允許您使用 cmd 自動尋找並刪除重複檔案。步驟來了。
Windows PowerShell(管理員)
以管理員身分執行Windows PowerShell。
第 2 步:彈出 PowerShell 視窗後,輸入 set-location –path C:
並按下Enter。
注意:在輸入指令之前,將
C:
Step 3: To find duplicate files using cmd in Windows PowerShell, enter following command and press Enter.
ls "scan folder" -recurse | get-filehash | group -property hash | where { $_.count -gt 1 } | % { $_.group } | Out-File -FilePath "scan result location"
Note: Here scan folder need to be changed into specific folder and scan result location need to be changed into the path where you want to export the list of duplicate files.
As mentioned above, this command will create a list of duplicate files, and you can delete the duplicate files according to the file path displayed in the list.
Step 4: To automatically delete duplicate files using cmd, enter following command and press Enter.
ls "search folder" -recurse | get-filehash | group -property hash | where { $_.count -gt 1 } | % { $_.group | select -skip 1 } | del
Note: Please replace search folder with specific folder path.
Compared with using cmd to find and delete duplicate files on Windows, using a professional duplicate file finder seems much easier. Here you should definitely have a try on iSumsoft DupFile Refixer. iSumsoft DupFile Refixer is a useful and reliable untility designed to automatically detect and sort out all formats of duplicate files on Windows. Moreover, it can help you mass delete all duplicate files across different files/folders at a time.
Let’s install iSumsoft DupFile Refixer on Windows and learn about how to find and delete duplicate files without using cmd.
Download
Step 1: Launch this duplicate file finder after installing it and click Add icon to select scan folder/drive.
Step 2: After adding the desired drive/folder to scan directory, click Start scanning to automatically check for duplicate files.
Step 3: When the scanning is completed, iSumsoft DupFile Refixer will create a scan report showing all duplicate files with file name, extension, size and date. It is easy for you to delete all duplicate files in bulk by clicking the box for File Name. If you want to check more details about the duplicate file, just right-click it and choose Open file location.
iSumsoft DupFile Refixer allows you to customize scan settings to filter scanning items by clicking Settings on the home page.
1. You can check the box for All Types to scan for all kinds of duplicate files including pictures, videos, audio, etc.
2. You are able to Enter minimum size and maximum size to scan for duplicate files in a specific size.
3. You are allowed to skip hidden files, system files, program files and files in recycle bin during scanning.
Once the settings is finished, click OK to save the settings.
Using Command is a good option to find and remove duplicate files on your Windows Computer. But if you are looking for an easier and safer way, it is recommended to use an effective and easy-to-use duplicate file finder like iSumsoft DupFile Refixer which can help you accurately find out and fast delete duplicate files on Windows.
以上是如何使用 CMD 在 Windows 10 中尋找並刪除重複文件的詳細內容。更多資訊請關注PHP中文網其他相關文章!