Windows 7 的 Cmd 循环

Windows 7 的 Cmd 循环

我想让这个命令循环 30 秒然后完成:

@Echo off
pause
Title Matrix
Color 0A
:top
Echo %Random%%Random%%Random%%Random%%Random%­%Random%%Random%%Random%%Random%%Random%­%Random%%Random%%
(not loop the pause, just the %random%)

答案1

这可能有效

@echo off

set looptime=30
set /a "T1=(%time:~6,2% + %looptime% ) %% 60"

:loop
  Echo %Random%%Random%%Random%%Random%%Random%­%Random%%Random%%Random%%Random%%Random%­%Random%%Random%%
  set T2=%time:~6,2%
  if not %T1% == %T2% goto loop

:: continue with whatever

相关内容