Spinner help
Posted: 19 Apr 2017 12:29
What is wrong with my code?
I want it to make a spinner, it is supposed to type a character backspace it, then type the next character, and so on. what it does instead is echo "- \ | /" over and over again
I want it to make a spinner, it is supposed to type a character backspace it, then type the next character, and so on. what it does instead is echo "- \ | /" over and over again
Code: Select all
@echo off
setlocal EnableDelayedExpansion
::--------------------------------------------------------------------------------------------------------------------------
set "$Defines=$BS" &set "$Details=Create $ESC Ascii-0x1B-27, Expansion insensitive"
::
::(
for /f "delims=#" %%a in (
'"prompt #$H# &echo on &for %%b in (1) do rem"'
) do (
set "%$Defines%=%%a"
set "%$Defines%=!$BS:~0,1!"
)
set "s1=-"
set "s2=\"
set "s3=^|"
set "s4=/"
:spinner
echo %s1% %$BS% %s2% %$BS% %s3% %$BS% %s4% %$BS%
:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
FOR %%a IN (1,5,10) DO (call :spinner)