Windows – Batch create folders

command linepowershellwindowswindows 8

I'm looking for a way to batch create a folder followed by sub-folders.

I'm looking at something like

c:\users\user\desktop\sample\1
c:\users\user\desktop\sample\2

etc.

Any ideas?

I'd prefer .cmd/PowerShell methods to do so.

If there's a way to do so via a terminal, I'll be happy to attempt any ideas/solutions by booting into a Linux live disc via usb.

Best Answer

You can use the command md like so:

for /l %a in (1,1,2) do md "c:\users\user\desktop\sample\folder %a"

This would create the two folders as in your example.