@echo off
setlocal EnableDelayedExpansion
set "var1=abcdefg"
set "var2="
for /l %%i in (0,1,6) do call set "var2=!var2!-%%var1:~%%i,1%%"
echo;%var2:~1%
endlocal
@echo off
setlocal EnableDelayedExpansion
set "var1=abcdefg"
set "var2="
for /l %%i in (0,1,6) do call set "var2=!var2!-%%var1:~%%i,1%%"
echo;%var2:~1%
endlocal