Created
July 29, 2014 15:20
-
-
Save Archigos/0e34219b4a8b82358bb0 to your computer and use it in GitHub Desktop.
Add a progress bar to you batch files
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
REM Supplemental Batch File | |
REM Use 'CALL progressbar XX' in other scripts (where XX is a number 0 - 100) | |
REM Example: CALL progressbar 50 | |
@ECHO OFF | |
:ProgressMeter | |
SETLOCAL ENABLEDELAYEDEXPANSION | |
SET ProgressPercent=%1 | |
SET /A NumBars=%ProgressPercent%/2 | |
SET /A NumSpaces=50-%NumBars% | |
SET Meter= | |
FOR /L %%A IN (%NumBars%,-1,1) DO SET Meter=!Meter!I | |
FOR /L %%A IN (%NumSpaces%,-1,1) DO SET Meter=!Meter! | |
TITLE Progress: [%Meter%] %ProgressPercent%%% | |
ENDLOCAL | |
GOTO :EOF |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment