1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
| @Echo off
Setlocal Enabledelayedexpansion
set LogFile="%~dp0Log.txt"
Set PathSrc="D:\"
For /R %PathSrc% %%Z In (.) Do (
pushd "%%Z"
title %%Z
For /F "delims=" %%a In ('"dir/b/a-d/on 2>Nul"') do (
Set "$Base=%%a"
If "!$Base:~0,1!" Neq "." (
Set "$Base=%%~na"
Set "$Name=!$Base:~0,16!*%%~xa"
) Else Set "$Name=!$Base:~0,16!*"
Set "$Subs=!$Base:~16!"
Set $Cnt=0
If defined $Subs (
For %%o In ("%%~fZ\!$Name!") do Set /A $Cnt+=1
If !$Cnt! gtr 1 echo(%%~fZ\%%a
)
)
popd
)>>%LogFile%
Endlocal & Pause |