批处理新手入门导读[视频教程]批处理基础视频教程[视频教程]VBS基础视频教程
[批处理文件精品]批处理版照片整理器[批处理文件精品]纯批处理备份&还原驱动在线第三方下载
返回列表 发帖
@echo off
set num=10 9 8 7 6 5 4 3 2 1
for %%i in (%num%) do (
        echo %%i
        ping 127.0.0.1 >nul
)
pause

TOP

@echo off
set "times=10"
echo 按任意字母键退出运行程序,默认 10 秒启动程序
:bgn
set/p=还剩下 %times% 秒...<nul
if "%times%"=="0" goto :run

set /a "times-=1"
choice /T 1 /C 0e /d 0 >nul
if "%errorlevel%"=="1" (goto :bgn) else (goto :end)


:run
echo.
echo 程序已经启动...
pause>nul
goto :eof


:end
echo.
echo 已经退出程序...

pause>nul

TOP

  1. set a=10
  2. :times
  3. echo %a%
  4. set t=%time:~0,8%
  5. :loop
  6. if %t% == %time:~0,8% goto loop
  7. if %a% lss 0 goto out
  8. set /a a-=1
  9. goto times
  10. :out
  11. pause>nul
复制代码

TOP

  1. @echo off
  2. for /l %%i in (10,-1,1) do (echo %%i & ping 127.1 -n 2 2>&1 >null)
复制代码

TOP

我是不是第一个写timeout延迟的人:handshake
  1. @echo off
  2. :a
  3. echo 10&timeout /nobreak 1>nul
  4. echo 9&timeout /nobreak 1>nul
  5. echo 8&timeout /nobreak 1>nul
  6. echo 7&timeout /nobreak 1>nul
  7. echo 6&timeout /nobreak 1>nul
  8. echo 5&timeout /nobreak 1>nul
  9. echo 4&timeout /nobreak 1>nul
  10. echo 3&timeout /nobreak 1>nul
  11. echo 2&timeout /nobreak 1>nul
  12. echo 1&timeout /nobreak 1>nul
  13. echo 0&timeout /nobreak 1>nul
  14. goto a
复制代码

TOP

@echo off
for /l in (0 1 10) do (
echo %%i
ping 127.1 -t -n 2
)

TOP

返回列表