- @echo off
- setlocal enabledelayedexpansion
- set ext=rar zip
-
- for /f "skip=%skpn% delims=" %%C in (test.txt) do (
- if "%%C"=="" echo;整理完成!&pause&goto :eof
- set word=%%C
- set exist=
- for %%a in (%ext%) do (
- if exist "*!word!*.%%a" set exist=d
- )
- if "!exist!"=="" (
- echo;不存在含“!word!”的文件名
- ) else (
- md "!word!"
- for %%a in (%ext%) do (
- move "*!word!*.%%a" "!word!"
- )
- )
- )
复制代码
|