@echo off
set 密码长度=9
:start
set /a m=%random%
set /a m=m%%36+1
if %m%==1 set xy=0&goto :xy
if %m%==2 set xy=1&goto :xy
if %m%==3 set xy=2&goto :xy
if %m%==4 set xy=3&goto :xy
if %m%==5 set xy=4&goto :xy
if %m%==6 set xy=5&goto :xy
if %m%==7 set xy=6&goto :xy
if %m%==8 set xy=7&goto :xy
if %m%==9 set xy=8&goto :xy
if %m%==10 set xy=9&goto :xy
if %m%==11 set xy=a&goto :xy
if %m%==12 set xy=b&goto :xy
if %m%==13 set xy=c&goto :xy
if %m%==14 set xy=d&goto :xy
if %m%==15 set xy=e&goto :xy
if %m%==16 set xy=f&goto :xy
if %m%==17 set xy=g&goto :xy
if %m%==18 set xy=h&goto :xy
if %m%==19 set xy=i&goto :xy
if %m%==20 set xy=j&goto :xy
if %m%==21 set xy=k&goto :xy
if %m%==22 set xy=l&goto :xy
if %m%==23 set xy=m&goto :xy
if %m%==24 set xy=n&goto :xy
if %m%==25 set xy=o&goto :xy
if %m%==26 set xy=p&goto :xy
if %m%==27 set xy=q&goto :xy
if %m%==28 set xy=r&goto :xy
if %m%==29 set xy=s&goto :xy
if %m%==30 set xy=t&goto :xy
if %m%==31 set xy=u&goto :xy
if %m%==32 set xy=v&goto :xy
if %m%==33 set xy=w&goto :xy
if %m%==34 set xy=x&goto :xy
if %m%==35 set xy=y&goto :xy
if %m%==36 set xy=z&goto :xy
:xy
set pass=%pass%%xy%
set /a n+=1
if %n%==%密码长度% goto :end
goto :start
:end
echo 随机密码是:%pass%
pause
echo %pass%>D:\文件.txt 可以保存密码,放到:end后一行。