@echo off setlocal enabledelayedexpansion

set "dir=%cd%" // 设置目录为当前目录

set "count=0" // 初始化重复文件数量为0

for /f "tokens=*" %%a in ('dir /b /s /a-d "%dir%" ^| sort') do ( set "file=%%~nxa" set "path=%%~dpa"

if not defined !file! (
    set "!file!=!path!%%a"
) else (
    set /a "count+=1"
    echo !file! >> 123.txt
    echo !file!:
    echo !path!%%a
    echo !%file%!
)

)

if %count% equ 0 ( echo No duplicate files found. ) else ( echo %count% duplicates found. Check 123.txt for details. )

pause exit /

编写一段windows的脚本找出该目录下重复的文件并将重复的文件的路径输入至123txt文件中。

原文地址: https://www.cveoy.top/t/topic/emD1 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录