# create folder with date and subfolder



## nomad (Sep 30, 1999)

I would like to build a batch file to create a folder with today's date and a sub-folder called Originals. This is what I have so far. Can some body please tell me how to add a the sub-folder.

for /f "tokens=1-3 delims=:/" %%i in ("%DATE%") do set DATESTAMP=%%i.%%j.%%k 
md %DATESTAMP%


----------



## Squashman (Apr 4, 2003)

```
md %DATESTAMP%\Orignals
```


----------



## nomad (Sep 30, 1999)

I tried that. The slash doesn't seem to work behind a system variable to create a sub directory. Have you actually tried this or am I doing something wrong?
thanks for you help


----------



## Squashman (Apr 4, 2003)

Doesn't like the periods for some reason.


----------



## Squashman (Apr 4, 2003)

Now I know why it worked for me the first time. Because I did it this way.

```
for /f "tokens=1-3 delims=:/" %%i in ("%DATE%") do MD "%%i.%%j.%%k\originals"
```
It seems to choke on the periods if you set a variable 1st and then use it because it thinks you are trying to access a file.

I think there is a way to escape the periods if you really need the date set as a variable.


----------

