本帖最后由 pcl_test 于 2015-4-14 22:36 编辑
- @echo off
- setlocal enabledelayedexpansion
- set "folder=D:\待处理"
- for /f "delims=" %%a in ('dir /ad /b "!folder!\"') do (
-
- set "fname=%%a"
- set /a n=m=s=0
- for /f "delims=" %%b in ('type "D:\特殊名称.txt"') do (
- if "!fname:%%b=!" neq "!fname!" (set /a n+=1 & md "!folder!\%%a\!n!%%b" 2>nul)
- )
-
- for /f "delims=" %%c in ('type "D:\所有名称.txt"') do (
- if "!fname:%%c=!" neq "!fname!" set /a m+=1
- )
-
- cd /d "!folder!\%%a"
- if !n! neq 0 (
- for %%d in (*.jpg) do set /a s+=1
- set /a r=s/m,z=0
- for %%i in (*.jpg) do (
- for /f "delims=" %%j in ('dir /ad /b "!m!*" 2^>nul') do set files=%%j
- if exist "!files!" (move "%%i" "!files!\" 2>nul)
- set /a z+=1
- if !z! == !r! (set z=0 &ren "!files!" "!files:~1!" 2>nul & set /a m-=1)
- )
- )
-
- )
- echo 完成!2秒后自动关闭
- ping 0 -n 3 >nul
- exit
复制代码
|