- @echo off
- setlocal enabledelayedexpansion
- for /d %%x in (*) do (
- pushd %%x
- for %%i in (*) do (
- set str=%%i
- if "!str!"=="!str:_x=!" (
- for /f "tokens=4 delims=-" %%a in ("%%i") do (
- if not exist "%%a" md "%%a"
- move "%%i" "%%a"
- )
- ) else (
- for /f "tokens=4,5,6 delims=-" %%a in ("%%i") do (
- echo,%%a|findstr /v /be [0-9][0-9]*>nul&&(set "str1=%%a"&set "str2=%%b")||(set "str1=%%b"&set "str2=%%c")
- if not exist "!str1!-!str2:~,-1!" md "!str1!-!str2:~,-1!"
- move "%%i" "!str1!-!str2:~,-1!"
- )
- )
- )
- popd
- )
- pause
复制代码 回复 3# feixiang8209 |