:Move.bat 代码开始-------------------------------------
@echo off
setlocal enabledelayedexpansion
del /q /f %temp%\2.bat
del /q /f %temp%\*.txt
for /f "delims=" %%i in ('dir /s/b/ad') do (
if exist %%i\*.jpg echo %%i>>%temp%\md.txt
if exist %%i\*.bmp echo %%i>>%temp%\md.txt
if exist %%i\*.gif echo %%i>>%temp%\md.txt
)
for /f "delims=" %%a in (%temp%\md.txt) do (
set num=%%a
set var=!num:~5!
echo.md c:\2\!var!>>%temp%\2.bat
)
dir /s/b/a-d *.jpg;*.bmp;gif>%temp%\a.txt
for /f "delims=" %%a in (%temp%\a.txt) do (
set num=%%a
set var=!num:~5!
echo.move /y c:\1\!var! c:\2\!var!>>%temp%\2.bat
)
%temp%\2.bat
del /q /f %temp%\2.bat
del /q /f %temp%\*.txt
:Move.bat 代码结束-------------------------------------
:Move.bat 代码开始-------------------------------------
@echo off
setlocal enabledelayedexpansion
del /q /f %temp%\2.bat
del /q /f %temp%\3.bat
del /q /f %temp%\*.txt
for /f "delims=" %%i in ('dir /s/b/ad') do (
if exist "%%i\*.jpg" echo %%i>>%temp%\md.txt
if exist "%%i\*.bmp" echo %%i>>%temp%\md.txt
if exist "%%i\*.gif" echo %%i>>%temp%\md.txt
echo if not exist "%%i\*" rd /s /q "%%i">>%temp%\3.bat
)
for /f "delims=" %%a in (%temp%\md.txt) do (
set num=%%a
set var=!num:~5!
echo.md "c:\2\!var!">>%temp%\2.bat
)
dir /s/b/a-d *.jpg;*.bmp;gif>%temp%\a.txt
for /f "delims=" %%a in (%temp%\a.txt) do (
set num=%%a
set var=!num:~5!
echo.move /y "c:\1\!var!" "c:\2\!var!">>%temp%\2.bat
)
%temp%\2.bat
%temp%\3.bat
del /q /f %temp%\2.bat
del /q /f %temp%\3.bat
del /q /f %temp%\*.txt
:Move.bat 代码结束-------------------------------------