这样试:- @echo off
- set "srcDir=D:\XYZ"
- set "re=%srcDir:\=\\%\\[^\\]*\\[^\\]*$"
- pushd "%srcDir%\"
- for /f "delims=" %%a in ('dir /ad/b/s^|findstr /irc:"%re%"') do (
- md "%%a\表格图片"
- move "%%a\地籍调查表.jpg" "%%a\表格图片"
- ) 2>nul
- pause
复制代码
- @echo off
- pushd "D:\XYZ\"
- for /f "delims=" %%a in ('dir /b /s 地籍调查表.jpg?') do (
- for %%b in ("%%~dpa.") do (
- if "%%~nxb" NEQ "表格图片" (
- md "%%~dpa表格图片"
- move "%%a" "%%~dpa表格图片\"
- )
- )
- ) 2>nul
- pause
复制代码
|