本帖最后由 BHsolve 于 2014-1-15 09:43 编辑
- @echo off
- setlocal enabledelayedexpansion
- set eng=abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ
- set /p num=生成文件个数(个数^=^<52):
- :begin
- set /a num-=1
- for /l %%i in (0,1,%num%) do (
- set /a a=!random!%%52
- if defined _!a! set /a num+=1&goto begin
- set "text=!eng:~%a%,1!"
- echo >nul 2> !text!.txt
- set "_!a!=!a!"&goto begin
- )
- pause > nul
复制代码 生成的文件数比输入的文件数少,求查错 |