I've been trying to create a basic batch script that will create folder for the current year (e.g. 2014) and then a sub-folder for the current month (June, etc...). Once these are established, I need to create folders based on the different domains in our forest (e.g. Homer, Janeway, Autobots domains).
When I type date, I get the following (it's the same on all our systems):
Mon 06/30/2014
Here is the code I have so far:
set yearfoldername=%date:~-4%
set month=%date:~-10,2%
set 01=January
set 02=February
set 03=March
set 04=April
set 05=May
set 06=June
set 07=July
set 08=August
set 09=September
set 10=October
set 11=November
set 12=December
md %yearfoldername%
md %yearfoldername%\%%month%%
md %yearfoldername%\%%month%%\Homer
md %yearfoldername%\%%month%%\Janeway
md %yearfoldername%\%%month%%\Autobots
As it stands, it only creates folders that look like this: 2014\%month%\Homer instead of 2014\June\Homer