Skip to content

Instantly share code, notes, and snippets.

@Archigos
Created July 29, 2014 15:20
Show Gist options
  • Save Archigos/0e34219b4a8b82358bb0 to your computer and use it in GitHub Desktop.
Save Archigos/0e34219b4a8b82358bb0 to your computer and use it in GitHub Desktop.
Add a progress bar to you batch files
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