首页 > 技术文章 > CMD定时倒数

victorfrost 2017-09-12 10:38 原文

修改if %count%==20 goto finish改变秒数

CMD:

mode con: cols=80 lines=25
color 4f
title Please Wait
SET /P var=Progress counter : <NUL

set count=0
:loop
 PING -n 2 127.0.0.1 >NUL 2>&1
 call :printline .
 set /a count=count+1
 if %count%==20 goto finish
goto loop

:printline
 REM Print text passed to sub without a carriage return.
 REM Sets line variable in case %1 intereferes with redirect
 set line=%1
 set /p var=%line%<NUL
exit /b

:finish
cls
color 0f
title Finished
mode con: cols=80 lines=25
echo Thankyou, all done now.
pause
exit /b

推荐阅读