@echo off setlocal enabledelayedexpansion set str=ABCDEFGHIJKLMNOPQRSTUVWXYZ set /a n=%random%%%26 echo !str:~%n%,1! pause复制代码
("ABHIJKLMNOPQRSTUVWXYZ").tochararray() |Get-Random复制代码