FileForums

FileForums (https://fileforums.com/index.php)
-   Software (https://fileforums.com/forumdisplay.php?f=32)
-   -   Code for Making Circular progress bar(or loading bar) in cmd(Batch or .bat) (https://fileforums.com/showthread.php?t=104414)

Newbie-repacker 11-05-2021 09:25

Code for Making Circular progress bar(or loading bar) in cmd(Batch or .bat)
 
Like this is an example of rectangular box

Code:

@echo off
    color 0A
   
   
    setlocal EnableDelayedExpansion
    set Counter=10
    set Schalter=100
    set Width=100
   
    :1
    set /a Counter=%Counter% + 1
    set /a Display=%Counter% / 2
    FOR /L %%A IN (1,1,%Display%) DO (
      set Display=!Display!█
    )
    cls
    echo    Loading...                                  %Counter%%%
    echo    █!Display:~2,47!
    ping localhost -n 1 >nul
    if "%Counter%" == "93" endlocal & goto End
    goto 1
   
    :End
    cls

And if such is this possible in batch to make circular progress bars??
How to make such with circular progress bar......????

Joe Forster/STA 11-05-2021 12:17

Quote:

Originally Posted by Newbie-repacker (Post 491901)
Like this is an example of rectangular box
And if such is this possible in batch to make circular progress bars??
How to make such with circular progress bar......????

Sorry, that rectangular box doesn't appear correctly in my browser. What do you mean by a "circular progress bar"? Here's a modified version with a rotating hyphen:
Code:

@echo off
color 0A


setlocal EnableDelayedExpansion
set Counter=10
set Schalter=100
set Width=100
set "RotateChars=-\|/"

:1
set /a Counter=%Counter% + 1
set /a Display=%Counter% / 2
set /a RotateIndex=%Counter% %% 4
set "RotateChar=!RotateChars:~%RotateIndex%,1!"
FOR /L %%A IN (1,1,%Display%) DO (
  set Display=!Display!█
)
cls
echo    Loading...                                  %Counter%%% ^%RotateChar%
echo    █!Display:~2,47!
ping localhost -n 1 >nul
if "%Counter%" == "93" endlocal & goto End
goto 1

:End
cls


Newbie-repacker 11-05-2021 20:04

1 Attachment(s)
Looking for something like this in .bat
Not exactly like this but somewhat near to this.......

https://i.ibb.co/Zmqg2jG/maxresdefault.jpg


And u will have to save the above code in a .bat to get progress bar like in attachment
And it will look like this...........

https://i.ibb.co/ZNP0L32/progress-bar.png

Joe Forster/STA 12-05-2021 01:19

(I fixed the rectangular box character in the code. Make sure to preview your posts. Code pages are tricky.)

You can't draw pictures from batch files. You can work with text. (Well, you can do anything from batch files if you write additional commands in external programs and call them from batch files but what's the point of using a batch file then? This is the same problem as BASIC and machine code on microcomputers: if you understand what BASIC is capable of - pretty much nothing - then the only thing you'll use it for is to start a machine code program. ;))


All times are GMT -7. The time now is 22:04.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
FileForums @ https://fileforums.com