本帖最后由 pcl_test 于 2015-3-26 10:16 编辑
回复 1# playinthesky - @echo off & setlocal enabledelayedexpansion
- for /f "tokens=1-4 delims=-" %%a in ('dir /b /a-d *.jpg') do (
- set "str=%%a-%%b-%%c-%%d"
- set "str=!str:~,-1!"
- ::如需同时处理其他数字,在下面括号里自行添加,如(2 6 9)
- for %%i in (2) do (
- if exist "!str!%%i-*.jpg" md "%%i\!str!%%i\" 2>nul
- move "!str!%%i-*.jpg" "%%i\!str!%%i\" 2>nul
- )
- )
- pause
复制代码
|