批处理文件实现进度条的效果

类似于git或者Node下载文件的时候那种滚动条效果

@echo off
setlocal

set COUNT=0
set MAXCOUNT=200
set SECONDS=1

:LOOP
cls
@echo "....................\"
call :WAIT
cls
@echo "....................|"
call :WAIT
cls
@echo "..................../"
call :WAIT
cls
@echo "....................-"
call :WAIT
if /i "%COUNT%" equ "%MAXCOUNT%" goto :EXIT
set /a count+=1
rem echo %COUNT%

goto :LOOP

:WAIT
ping -n %SECONDS% 127.0.0.1 > nul
ping -n %SECONDS% 127.0.0.1 > nul
ping -n %SECONDS% 127.0.0.1 > nul
goto :EOF

:EXIT
title FIN!
endlocal

 

posted on 2019-09-27 14:03  Neo0820  阅读(2808)  评论(0编辑  收藏  举报

导航