Skip to content

Instantly share code, notes, and snippets.

@RadAd
Created August 22, 2023 03:42
Show Gist options
  • Save RadAd/c5e5186d4a82e470cbe18fb1efe7f0f0 to your computer and use it in GitHub Desktop.
Save RadAd/c5e5186d4a82e470cbe18fb1efe7f0f0 to your computer and use it in GitHub Desktop.
@echo off
setlocal ENABLEEXTENSIONS ENABLEDELAYEDEXPANSION
prompt $G$S
set BAR_A=########################################
set BAR_B=%BAR_A:#=_%
set BAR_S=40
set C=500
echo.
for /L %%i in (0,1,%C%) do (
call :progress %%i %C%
rem timeout.exe /t 1 > NUL
)
conprint "\e]9;4;0\u0007"
echo.
goto :eof
:progress
set /A P=%1*100/%2
set /A A=%1*%BAR_S%/%2
set /A B=%BAR_S%-%A%
conprint "\r[!BAR_A:~0,%A%!!BAR_B:~0,%B%!] %1/%2 %P%%%%%"
conprint "\e]9;4;1;%P%\u0007"
goto :eof
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment