回复 5# zhengzhenhui
- @echo off
- rem 批处理保存为ansi编码格式
- rem n大于等于2
- set n=3
- set f="关键字1" "关键字2" "关键字3"
- for /l %%l in (2,1,%n%) do (
- call set str=%%str%%\\.*
- )
- for /f "delims=" %%a in ('forfiles /s /c "cmd /c if @isdir==TRUE echo @relpath" ^|findstr /rc:"%str%" ^|findstr /rvc:"%str%\\.*" ') do (
- for %%x in (%f%) do (
- if exist "%%~a\%%~x*.*" (
- md "%%~a\%%~x"
- move "%%~a\%%~x*.*" "%%~a\%%~x\"
- )
- )
- )
- pause
复制代码
|