[新手上路]批处理新手入门导读[视频教程]批处理基础视频教程[视频教程]VBS基础视频教程[批处理精品]批处理版照片整理器
[批处理精品]纯批处理备份&还原驱动[批处理精品]CMD命令50条不能说的秘密[在线下载]第三方命令行工具[在线帮助]VBScript / JScript 在线参考
返回列表 发帖
  1. @echo off&setlocal enabledelayedexpansion
  2. set t=0
  3. for /l %%i in  (0 1 10) do (
  4. for /l %%i in  (0 1 6000) do echo e>nul
  5. set /a t=!t!+1
  6. echo !t!
  7. )
复制代码
(自己生物钟不准,时间不知道对不对得上……)

TOP

@echo off
set /a num+=1
set /a new=11-%num%
cls & echo %new% & ping -n 2 127.1>nul
if %new% neq 0  %0

TOP

@echo off

set /a timer=10

echo ======倒计时开始======
timeout 1 >nul

:loop
cls
if %timer% geq 0 (echo %timer%) else (goto :eof)
set /a timer = timer - 1
timeout 1 >nul
call :loop

exit /b

TOP

@echo off
set a=10
:XH
cls
echo 十秒倒计时:%a%
if %a% GTR 1 (
    set /a a-=1
    ping -n 2 127.1>nul
    goto XH
    ) else (
    pause
)

TOP

@echo off
set /p =等待10秒后退出:<nul
for /l %%i in (9,-1,0) do (
    set /p =%%i<nul
    set /p =<nul
    ping -n 2 127.1 >nul
)
cls
echo,
pause

TOP

@echo off
for /l %%i in (10,-1,0) do (
        echo %%i
        ping 1 -n 2 >nul
)
pause>nul

TOP

延时用timeout指令

TOP

@echo off
for /l %%i in (10 -1 0) do ping -w 2 -n 2 127.1>nul & cls & echo %%i
pause

TOP

@echo off
for /l %%i in (10 -1 0) do timeout /t 2 /nobreak>nul & cls & echo %%i
pause

TOP

本帖最后由 LTSC1809 于 2023-4-24 19:56 编辑

回复 1# wxcute
@echo off
set m=11
:a
set /a m=m-1
timeout 1 /nobreak >nul
echo %m%
if %m% equ 1=pause&exit
goto a

TOP

@echo off
for /l %%i in (1,1,10) do (
        ping 127.0.0.1 -n 1>nul 2>&1
        echo %%i
)
pause

TOP

@echo off
for /l %%i in (10 -1 1) do (
        ping 127.0.0.1 -n 2 >nul
        echo %%i
)
pause>nul

TOP

返回列表