I cannot use a variable '%a' inside of variable 'varname' in this code:
@echo of
set varname=stringhere
for /l %%a in (1,1,10) do (
echo %varname:~1,%%a%
ping -n 0.01 >nul
)
But what it displays is:
a% a% a% a% a% a% a% a% a% a%
What I want it to display as:
s st str stri strin string stringh stringhe stringher stringhere
So in words I am trying to optimize my code as much as possible and I want to make a function that prints out a variable one letter at a time but it isn't letting me use substring in the way I want it to..