I'm writing a batch file to automate downloading a game called dwarf fortress with a bunch of other files and images. I have everything working, but now I want to provide the user with the ability to choose a color set from a downloaded folder of .txt files. The trouble is, I want to provide the available color set names based on the file names, so I need to iterate over the folder and get the names of the files (without the .txt extension), and add them to a single string with the format
filename, filename, ... etc. I am able to iterate over the files, but I cannot figure out how to make that single string. Here's what I have so far (I know it doesn't work):
set /a colorFileNames="" for %%f in (%CD%\colors\colors\*) do ( set %temp%=%%f set colorFileNames="%%colorFileNames%%, %temp%:~0,-3" )
I then will use the
colorFileNames in the question for the user.