|
本帖最后由 2010techon 于 2022-4-18 10:55 编辑
是要随机执行10种调用? 我没理解错吧:
- @echo off
- :_begin
- set _r0=%random%
- set /a _r=_r0%%10
- echo, random==%_r%
- call :_%_r%
- rem 或者直接 call :_%random:~-1%
- pause&goto :_begin
- :_0
- echo,当前执行“%0”
- ping 127.1 -n 1>nul
- goto :eof
- :_1
- echo,当前执行“%0”
- ping 127.1 -n 1>nul
- goto :eof
- :_2
- echo,当前执行“%0”
- ping 127.1 -n 1>nul
- goto :eof
- :_3
- echo,当前执行“%0”
- ping 127.1 -n 1>nul
- goto :eof
- :_4
- echo,当前执行“%0”
- ping 127.1 -n 1>nul
- goto :eof
- :_5
- echo,当前执行“%0”
- ping 127.1 -n 1>nul
- goto :eof
- :_6
- echo,当前执行“%0”
- ping 127.1 -n 1>nul
- goto :eof
- :_7
- echo,当前执行“%0”
- ping 127.1 -n 1>nul
- goto :eof
- :_8
- echo,当前执行“%0”
- ping 127.1 -n 1>nul
- goto :eof
- :_9
- echo,当前执行“%0”
- ping 127.1 -n 1>nul
- goto :eof
复制代码
|
|