文件根据名称整理至不同文件夹
@echo off
setlocal EnableDelayedExpansion
set "currentDir=%cd%"
for %%a in (*.mp4) do (
if not exist "%currentDir%\%%~na" (
mkdir "%currentDir%\%%~na"
)
move "%%a" "%currentDir%\%%~na"
)
for %%a in (*.png) do (
set "filename=%%~na"
set "filepath=%currentDir%\!filename:~0,19!"
if not exist "!filepath!" (
mkdir "!filepath!"
)
move "%%a" "!filepath!"
)
echo "*****************"
echo "*** completed ***"
echo "*****************"
pause