# [SOLVED] Using mkdir to make several numbered folders?



## jbknight3 (May 5, 2010)

I already know how to make several folders in a notepad document saved as .cmd (Example: mkdir "Folder 1" "Folder 2" "Folder 3")

But what I was wondering is if there is an easier way to number all of them.

Maybe something like using notepad and copying and pasting like 100 folders called "Folder 1 " with the space so they are all spaced. (mkdir "Folder 1" "Folder 1" "Folder 1") Then using the find and replace somehow to replace the 1 with the numbers 1 - 100?

Im not sure if it's possible with notepad or at all for that matter.

But if you guys have any suggestions, I'd love to hear them. i just think it would be a pain to go through and change all of the 1's manually.

Thanks In Advance!

-----Jon-----


----------



## TheOutcaste (Mar 19, 2009)

*Re: Using mkdir to make several numbered folders?*

This will do it. Set the starting and ending numbers, and the parent folder path in the first three lines, save it with a .bat or .cmd extension, then run it.


```
Set _StartNum=1
Set _EndNum=100
Set _Root=C:\Test
PushD "%_Root%"
For /L %%I In (%_StartNum%,1,%_EndNum%) Do If Not Exist "Folder %%I" Md "Folder %%I"
PopD
```


----------



## jbknight3 (May 5, 2010)

*Re: Using mkdir to make several numbered folders?*

Thank you very much! That worked perfectly.


----------



## TheOutcaste (Mar 19, 2009)

*Re: Using mkdir to make several numbered folders?*

You're Welcome!

If your issue has been resolved you can mark this thread Solved by using the Thread Tools at the Top Right of this thread (above the first post) :grin:

Jerry


----------

