I need to try these above but after a lot of searching and a few adjustments I finally got the one below to wortk: Except
It has nothing but visual output. I swear I am getting too old for this. This is a simple reciursice batch file but every place i have tried to insert a redirect to a text file for the output fails miserably. Anyone who sees my blindspot, please insert it where it belongs and I will take my bashing.
Maybe this is just too easy to see?
@echo off
setlocal
set currentLevel=0
set maxLevel=%2
if not defined maxLevel set maxLevel=2 << This is where i need it set to get the list i need with the levels i need. I can see them fly past and i used to know how to catch them.
:procFolder
pushd %1 2>nul || exit /b
if %currentLevel% lss %maxLevel% (
for /d %%F in (*) do (
echo %%~fF <<This is where I thought I could catch the output but no go
set /a currentLevel+=1
call :procFolder "%%F"
set /a currentLevel-=1
)
)
popd