知道了,不只是15会出现这种情况,凡是文件个数为3的倍数,都会这样。修改如下:- @echo off
- setlocal enabledelayedexpansion
- for /f "delims=" %%k in ('dir /ad /b') do (
- set n=0
- set sign1=1
- set "as=%%k"
- for /f "delims=" %%i in ('dir /a /b !as!\thumb') do (
- set /a n+=1
- set /a sign2=n%%30,sign3=n%%3
- if !sign2! equ 1 cd.>"%%k_!sign1!.txt"
- if !sign3! equ 1 echo ^<tr^>>>"!as!_!sign1!.txt"
- echo ^<td^>%%~nxi^</td^>>>"!as!_!sign1!.txt"
- if !sign3! equ 0 echo ^</tr^>>>"!as!_!sign1!.txt"
- set /a sign1=n/30+1
- )
- if not !sign3! equ 0 echo ^</tr^>>>"%%k_!sign1!.txt"
- )
- echo 执行完毕!&pause>nul
复制代码
|