本帖最后由 bailong360 于 2015-4-6 22:49 编辑
- @Echo Off >nul 2>&1 3>&1 4>&1
- SetLocal EnableDelayedExpansion
- For /F "Delims=" %%a In ('Dir /A-D /B^|Find /v ".bat"') Do (
- Set "FileName=%%~na"
- Echo !FileName:~-6!|Findstr "^[0-9]*$"&&(
- If "!FileName:~-7,1!"=="-" (
- Set "FileName=!FileName:~0,-7!%%~xa"
- ) Else Set "FileName=!FileName:~0,-6!%%~xa"
- Md ".\!FileName!"
- Move "%%a" ".\!FileName!\"
- )||(
- For /F "Tokens=1-3 Delims=-" %%b In ("%%a") Do (
- Md "%%b-%%c-%%d%%~xa"
- Move "%%a" "%%b-%%c-%%d%%~xa\"
- )
- )
- )
复制代码
|