How to scan a folder/directory and find out duplicate files by windows batch using fc command?
利用批处理扫描目录,找出该目录下所有重复的相同的文件?
可以利用fc比较扫描到的所有文件。
批处理内容如下, save as finddup.bat:
@echo off
setlocal enabledelayedexpansion
for /r . %%i in (*.*) do (
for /r . %%j in (*.*) do (
if not "%%i" equ "%%j" (
rem echo 比较 "%%~ni" ---- "%%~nj"...
fc /a /b "%%i" "%%j" > nul
if !errorlevel! == 0 echo "%%~ni" ===== "%%~nj"
)
)
)