@echo off
setlocal enabledelayedexpansion
for /f "delims=" %%i in ('dir /b /a-h /s D:\scripts\TEST\00_\20100425_list_duplicate_files\*.txt *.doc') do (
for /f "delims=" %%i in ("%%~nxi") do (
if not defined %%i (
set %%i=A_ ) else (
set str=%%~nxi
for /r "D:\scripts\TEST\00_\20100425_list_duplicate_files\" %%i in (!str!) do (
if exist %%~fi echo. %%~nxi %%~fi %%~ti %%~zi >>tmp_.txt
)
)
)
)
pause
for /f "tokens=1* delims= " %%i in (tmp_.txt) do (
if not defined %%i set %%i=A & echo %%i %%j >>结果.txt
)
del tmp_.txt
pause
output as below.
1.txt D:\scripts\TEST\00_\20100425_list_duplicate_files\1.txt 2010/04/25 19:51 0
but show error as below.