Assume I have a folder that contains other folders that I don't necessarily know about:
|Folder
| |-- SubFolder1
| |-- SubFolder2
| |-- SubFolder3
I essentially want to map another location for the sub folders. So I create another batch file containing these sub folder names that can have another location set to them, e.g:
TYPE NUL > folders.cmd
FOR /D %%i IN (*) DO (@ECHO SET %%i=>>folders.cmd)
which produces:
SET SubFolder1=
SET SubFolder2=
SET SubFolder3=
Then if I was to open that file and set some values like so:
SET SubFolder1=C:\test1
SET SubFolder2=C:\test2
SET SubFolder3=C:\test3
How would I now access the variables/values in my batch file (especially when I may not know what they are).
I thought maybe I could do something like:
CALL folders.cmd
FOR /D %%i IN (*) DO (
@ECHO %%%i%%%
)
But this appears to be the incorrect way to do it.