- @echo off & setlocal enabledelayedexpansion
- cd /d "H:\pic\Nonslipnews"
- for /f "delims=" %%i in ('dir /b /a-d *.jpg ^| findstr /i /e "[_\-][0-9][0-9]*\.jpg"') do (
- set "file=%%i"
- set "file=!file:_=\_!"
- set "file=!file:-=\-!"
- for /f "delims=" %%j in ("\!file!") do set "folder=%%~pj"
- set "folder=!folder:\=!"
- if not exist "!folder!\" md "!folder!\"
- move "%%i" "!folder!\"
- )
- pause
复制代码
|