Here is an example of what I tried.
MKDIR H:\Acct COE\AR Chapter\FY 2012\Maine\SO Maine-Portland\Backup-September 2011
MKDIR H:\Acct COE\AR Chapter\FY 2012\Maine\SO Maine-Portland\Backup-September 2011\Posting Reports
A few things that you can do here to make this work out better for you. First, if at all possible to do so, I would try to change the naming convention if at all possible to use numbered months after "Backup", you'll see why in a minute. Second, it would be a lot easier to have the program prompt for certain things (like what FY it is) and then the rest of it can be hardcoded (much better than having to change the script every month). Anyway, here's the coding for setting up a prompt for the fiscal year:
echo Please enter the current fiscal year
set /p fy=(FY)
This will have the program spit out:
Please enter the current fiscal year
FY |
With the I being where the cursor would be.
Also, if you want to make sure that your putting it in the right location, you can put the following at an early point in the script:
net use H: /delete /y
net use H: [full network location] /persistent:yes
This will delete the network location on H: and then remap it to the H: drive you wish to utilize.
Now comes the time to make the actual directories:
MKDIR "H:\Acct COE\AR Chapter\FY %fy%\Maine\SO Maine-Portland\Backup-%date:~10%%date:~4,2%"
MKDIR "H:\Acct COE\AR Chapter\FY %fy%\Maine\SO Maine-Portland\Backup-%date:~10%%date:~4,2%\Posting Reports"
You'll notice the coding using the date variable in there as well. This will spit out the date the directory is made in a yyyymm format. So you'll end up with a file named "Backup-201109". You can adjust the layout of the date variables a little, and I'm sure you could likely use an additional piece of code to rewrite the month from numbers to letters if you wanted to. We can help out with that, but it would be up to you whether it is easier to change the naming convention or put in an even more involved piece of code in.