I'm trying to concatenate a repeating string depending on the first parameter value passed into the script when it is called. This value represents the number of directory levels the current directory is from the repository root in which the user is working. This is my script so far:
set REPO_ROOT="%~1"
set "UPPATH=.\"
set "UPDIR=..\"
for /l %%i in (1,1,%REPO_ROOT%) do set "UPPATH=%UPPATH%%UPDIR%"
echo %UPPATH%
My problem is that if I hard-code set "UPPATH=%UPPATH%%UPDIR%" any number of times, it works fine, but it doesn't seem to want to work in the loop. Any thoughts or suggestions on how to get this loop to work with the passed parameter would be appreciated. Thanks.