i want to make such as loading indicator just like : installation is running... and those dots should be appear progressively and once they are three their number should be reinitialized to one dot and all happens in the same line.
for this i've tried to mix code of two small scripts : the first plays continuestly the dots and the seconds makes a counter increase its value by echoing it in the same line.
at the end i got this code which is the closest solution for what i want to achieve but still with a problem which is that when there are already three dots, the next row which has less number of dots will overwrite its similar part from the previous one but the remaining part from the previous row will stay so at the end it looks like there are always three dots and all will looks like just a simple static echoed text..
here is the code :
@echo off
cls
setlocal EnableDelayedExpansion EnableExtensions
call :CreateCR
:spinner
set mSpinner=%mSpinner%.
if %mSpinner%'==.................................' (
set mSpinner=.
)
:: Wait one second.
ping 127.0.0.1 -n 2 >nul
set /P "=Installation Java en cours%mSpinner%!CR!" <nul
::set /p "=Installation Java en cours" <nul
::echo %mSpinner%
goto spinner
:exit
::echo(
goto :eof
:CreateCR
rem setlocal EnableDelayedExpansion EnableExtensions
set "X=."
for /L %%c in (1,1,13) DO set X=!X:~0,4094!!X:~0,4094!
echo !X! > %temp%\cr.tmp
echo\>> %temp%\cr.tmp
for /f "tokens=2 usebackq" %%a in ("%temp%\cr.tmp") do (
endlocal
set cr=%%a
goto :eof
)
goto :eof