for /f "delims=" %%a in ('dir /a-d/s/b *.wmv,*.mp4,*.avi,*.rmvb,*.rm,*.flv,*.mpg,*.mkv') do (
md "%%~na"
move %%a "%%~na\"
move "%%~na.jpg" "%%~na\"
)
pause
搜一下:求
根据文件名创建文件夹并将其移动进去的DOS批处理脚本
for /f "delims=" %%a in ('dir /a-d/s/b *.wmv,*.mp4,*.avi,*.rmvb,*.rm,*.flv,*.mpg,*.mkv,*.jpg') do (
md "%%~na"
move %%a "%%~na\"
move "%%~na.*" "%%~na\"
)
exit