Code: Select all
for /f "delims=" %%f in ('dir /A:D /b "C:\Users\P Ditty\Documents\SH3\data\cfg\Careers"') do (
set fullpath3=%%f
for /D %%J in ("!fullpath3!\..\..") do set careerdir3=%%~nxJ
)
But this will only make the variable one folder name in that directory at a time, or per loop. I'm looking to create a multiple choice user input question using all these folder names, one choice per folder.
The multiple choice will look something similar to this:
echo Select which career you'd like to play:
echo =============
echo.
echo 1) Folder Name 1
echo 2) Folder Name 2
echo 3) Folder Name 3
echo 4) Folder Name 4
etc...
echo 5) Exit
set /p web=Type option:
if "%web%"=="1" goto dynamiccampaign
if "%web%"=="2" goto list
if "%web%"=="3" start ipconfig.exe
if "%web%"=="4" Call cleanup.bat
if "%web%"=="5" exit
goto home
So how do I assign each folder its own variable, not knowing if there will only be 2 folders or it may be even up to 10 folders in that directory?
Thanks.