Hi i want to create a folder with year and month. eg 2015-01

January 22, 2015 at 15:01:32
Specs: Windows 7
Hi i want to create a batch file which helps me to create a folder with year and month. eg 2015-01 January
This folder needs to be created on a shared drive
Folder needs to be created under sub folders eg :R:\x\y\z\yyyy-mm-name of the month

Can anyone please help me on this request
I am newbee in creating batch file

Thanks


See More: Hi i want to create a folder with year and month. eg 2015-01

Report •

#1
January 22, 2015 at 18:27:08
Post the output of this:

echo %DATE%

=====================
M2 Golden-Triangle


Report •

#2
January 22, 2015 at 18:32:01
Hi,

Thanks f or the reply
Can you be more specific and let me know actual command to be typed


Report •

#3
January 22, 2015 at 18:38:01
Here's something to work with (I won't call it a solution):

@echo off & setlocal enabledelayedexpansion
set m=%date:~4,2%
set g=%date:~-4%-%m%
set mo=Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec
for %%a in (%mo%) do (
set /a c+=1
set !c!=%%a
)
set m= %m%
set m=%m: 0=%
set g=%g% !%m%!
echo md g=[%g%]
md "r:\x\y\z\%g%"

:===== end snippet
I'm sure powershell or vbscript have better resources for this, but you DID say batch.


Report •

Related Solutions

#4
January 22, 2015 at 18:44:16
Thanks
But this creates the folders which are already present

Is there any other VBscript options?

I am happy to switch ov


Report •

#5
January 22, 2015 at 20:37:54
I'm confused (as usual). Pls give an example of "folders already present" vs your intended folder. I assumed "todays date" as the launching pad, but maybe I'm wrong. Pls give lots of examples showing from some input date what IS and IS Not acceptible as output date.

Report •

Ask Question