title: Loading progress animation like with batch scripting
body: <p>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.</p>
  
  <p>for this i've tried to mix code of two small scripts : <a href="https://stackoverflow.com/questions/368041/how-to-code-a-spinner-for-waiting-processes-in-a-batch-file/368865#368865">the first</a> plays continuestly the dots
  and <a href="https://stackoverflow.com/questions/4097041/echoing-in-the-same-line/4097156#4097156">the seconds</a> makes a counter increase its value by echoing it in the same line.</p>
  
  <p>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..</p>
  
  <p>here is the code :</p>
  
  <pre><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 &gt;nul
  
          set /P "=Installation Java en cours%mSpinner%!CR!" &lt;nul
  
  
  ::set /p "=Installation Java en cours" &lt;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!  &gt; %temp%\cr.tmp
  echo\&gt;&gt; %temp%\cr.tmp
  for /f "tokens=2 usebackq" %%a in ("%temp%\cr.tmp") do (
     endlocal
     set cr=%%a
     goto :eof
  )
  goto :eof
  </code></pre>