swanseabrian 当前离线
五级士官
@echo off&setlocal enabledelayedexpansion for /f "delims=:" %%i in ('dir /b /ad') do ( echo "%%i" pushd "%%i" for /f "delims=:" %%a in ('dir /b /a-d *.jpg') do ( if not exist "%%~fi\%%a" ( echo "%%~fa" set name="%%~fa" copy /y !name! "%%i") if exist "%%~fi\%%a" ( set name="%%~fa" echo !name!>>D:\abc\1.txt) ) popd ) pause复制代码
qixiaobin0715 当前在线
大校
@echo off (for /f "delims=" %%i in ('dir /b /ad') do ( pushd "%%i" for /f "delims=" %%a in ('dir /b /a-d *.jpg') do ( if not exist "%~dp0%%a" ( copy "%%i" "%~dp0">nul ) else ( echo,%%~fa ) ) popd ))>"D:\abc\1.txt" pause复制代码
TOP
@echo off (for /f "delims=" %%i in ('dir /b /ad') do ( pushd "%%i" for /f "delims=" %%a in ('dir /b /s /a-d *.jpg') do ( if not exist "%%~fi\%%a" ( copy "%%a" "%%i">nul ) else ( echo,%%~fa ) ) popd ))>"D:\abc\1.txt" pause复制代码
@echo off (for /f "delims=" %%i in ('dir /b /ad') do ( pushd "%%i" for /f "delims=" %%a in ('dir /s /b /a-d *.jpg') do ( if not exist "%%~nxa" ( copy "%%a">nul ) else ( echo,%%a ) ) popd ))>"D:\abc\1.txt" pause复制代码
echo,%%~nxa echo,%%~fi\%%a pause复制代码