Eventually this batch file will expand to allow selection of creation of a range of subdirectories, however I've got to get the code correct first.
In the current directory I want to create the following subdirectories:
2010-11 FY
2011-12 FY
2012-13 FY
2013-14 FY
2014-15 FY
2015-16 FY
2016-17 FY
2017-18 FY
2018-19 FY
2019-20 FY
as they contain spaces, I need to exclude a space as a delimiter.
For /F uses file contents, however the contents are contained within a variable not a file.
If I replace the space in each element with an underscore, a simple for loop will work, but I want a space.
@echo off
:Main0
set DirNames=2010-11 FY,2011-12 FY,2012-13 FY,2013-14 FY,2014-15 FY,2015-16 FY,2016-17 FY,2017-18 FY,2018-19 FY,2019-20 FY
FOR /F "delims=," %%I in (%DirNames%) do echo mkdir %%I
:EndPause
pause
:End
The above code produces the error "The system cannot find the file 2010-11."
Thanks,
Bazzao