- @echo off
- rem 根据文件名将文件移动进以该文件名命名的文件夹里
- cd /d "%~dp0"
- for /f "delims=" %%a in ('dir /a-d/b *F*.pdf') do (
- if "%%~nxa" neq "%~nx0" (
- call :fun "%%a"
- )
- )
- pause
- exit /b
-
- :fun
- set "basename=%~n1"
- set "basename=%basename:~0,20%"
- set dstdir="%basename%\%basename%\图1\"
- 2>nul md %dstdir%
- echo;"%~1" --^> %dstdir%
- move "%~1" %dstdir%
复制代码
|