DonationCoder.com forum
 
Read-only archive. This is a static copy of the DonationCoder.com forum. Reading and searching work as before; logging in, posting and private messages do not.
Archive of 2026-10-21 · About this archive · Main site

Author Topic: Create Multiple Empty Numbered Folders  (Read 24,357 times)

CleverCat

  • Cat's Are Fun!
  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 1,164
Create Multiple Empty Numbered Folders
« on: January 09, 2009, 10:04 AM »
Is there any way to create about 150 numbered folders quickly?

Thanks..... :tellme:
If you need help - JUST ASK!

rjbull

  • Charter Member
  • Joined in 2005
  • ***
  • Posts: 3,217
Re: Create Multiple Empty Numbered Folders
« Reply #1 on: January 09, 2009, 10:27 AM »
Here's a quick way of making 100:

$1.bat:
Code
for %%a in (0 1 2 3 4 5 6 7 8 9) do call $2.bat %%a

$2.bat:
Code
for %%a in (0 1 2 3 4 5 6 7 8 9) do md %1%%a

Put them both in the same directory, and just run $1.bat.  Easy enough to generalise if you want more directories.




CleverCat

  • Cat's Are Fun!
  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 1,164
Re: Create Multiple Empty Numbered Folders
« Reply #2 on: January 09, 2009, 11:41 AM »
Thanks a million.... :Thmbsup:
If you need help - JUST ASK!

CleverCat

  • Cat's Are Fun!
  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 1,164
Re: Create Multiple Empty Numbered Folders
« Reply #3 on: January 09, 2009, 12:05 PM »
Works great - thanks! So if I need say 150?
If you need help - JUST ASK!

housetier

  • Charter Honorary Member
  • Joined in 2005
  • ***
  • Posts: 1,321
    • Gathering Badge
Re: Create Multiple Empty Numbered Folders
« Reply #4 on: January 09, 2009, 02:15 PM »
have 1.bat go from 0 to 15

aCkRiTe

  • Honorary Member
  • Joined in 2007
  • **
  • Posts: 21
Re: Create Multiple Empty Numbered Folders
« Reply #5 on: January 09, 2009, 03:29 PM »
Heres a way with AHK. Just run the script from the directory or location you want the folders to be created.

Code
Loop, 150
	FileCreateDir, %A_Index%
ExitApp

If you want to use a batch file you can use this. Of course change the path as needed.

Code
for /l %%i in (1,1,150) do mkdir "C:\Test\%%i"
« Last Edit: January 09, 2009, 03:45 PM by aCkRiTe »

CleverCat

  • Cat's Are Fun!
  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 1,164
Re: Create Multiple Empty Numbered Folders
« Reply #6 on: January 10, 2009, 06:51 AM »
have 1.bat go from 0 to 15

That makes 250 with some folders having 4 digits?
If you need help - JUST ASK!

CleverCat

  • Cat's Are Fun!
  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 1,164
Re: Create Multiple Empty Numbered Folders
« Reply #7 on: January 10, 2009, 07:00 AM »
Heres a way with AHK. Just run the script from the directory or location you want the folders to be created.

Code
Loop, 150
	FileCreateDir, %A_Index%
ExitApp

If you want to use a batch file you can use this. Of course change the path as needed.

Code
for /l %%i in (1,1,150) do mkdir "C:\Test\%%i"

How do I make each folder have 3 digits i.e, 001 etc. so Windows puts them in correct order?
If you need help - JUST ASK!

aCkRiTe

  • Honorary Member
  • Joined in 2007
  • **
  • Posts: 21
Re: Create Multiple Empty Numbered Folders
« Reply #8 on: January 10, 2009, 08:23 AM »
Code
Loop, 150
	{
		StringLen, Length, A_Index
		If Length = 1
			FileCreateDir, 00%A_Index%
		If Length = 2
			FileCreateDir, 0%A_Index%
		If Length = 3
			FileCreateDir, %A_Index%
	}
ExitApp

CleverCat

  • Cat's Are Fun!
  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 1,164
Re: Create Multiple Empty Numbered Folders
« Reply #9 on: January 10, 2009, 12:14 PM »
Awesome - works a treat!

A big thanks to all for the input!  :Thmbsup:
If you need help - JUST ASK!

by66

  • Participant
  • Joined in 2008
  • *
  • Posts: 1
Re: Create Multiple Empty Numbered Folders
« Reply #10 on: February 04, 2009, 05:58 AM »
Try this program, very powerfull
Flexible renamer

;D

Original address: https://www.donationcoder.com/forum/index.php?topic=16494.0