批處理文件實現進度條的效果

相似於git或者Node下載文件的時候那種滾動條效果git

@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
相關文章
相關標籤/搜索