topbanner_forum
  *

avatar image

Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
  • Thursday December 12, 2024, 12:30 am
  • Proudly celebrating 15+ years online.
  • Donate now to become a lifetime supporting member of the site and get a non-expiring license key for all of our programs.
  • donate

Author Topic: Create Multiple Empty Numbered Folders  (Read 21155 times)

CleverCat

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 1,164
    • View Profile
    • Donate to Member
Create Multiple Empty Numbered Folders
« on: January 09, 2009, 04:04 AM »
Is there any way to create about 150 numbered folders quickly?

Thanks..... :tellme:

rjbull

  • Charter Member
  • Joined in 2005
  • ***
  • default avatar
  • Posts: 3,205
    • View Profile
    • Donate to Member
Re: Create Multiple Empty Numbered Folders
« Reply #1 on: January 09, 2009, 04:27 AM »
Here's a quick way of making 100:

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

$2.bat:
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

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 1,164
    • View Profile
    • Donate to Member
Re: Create Multiple Empty Numbered Folders
« Reply #2 on: January 09, 2009, 05:41 AM »
Thanks a million.... :Thmbsup:

CleverCat

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 1,164
    • View Profile
    • Donate to Member
Re: Create Multiple Empty Numbered Folders
« Reply #3 on: January 09, 2009, 06:05 AM »
Works great - thanks! So if I need say 150?

housetier

  • Charter Honorary Member
  • Joined in 2005
  • ***
  • default avatar
  • Posts: 1,321
    • View Profile
    • Donate to Member
Re: Create Multiple Empty Numbered Folders
« Reply #4 on: January 09, 2009, 08:15 AM »
have 1.bat go from 0 to 15

aCkRiTe

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

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.

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

CleverCat

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 1,164
    • View Profile
    • Donate to Member
Re: Create Multiple Empty Numbered Folders
« Reply #6 on: January 10, 2009, 12:51 AM »
have 1.bat go from 0 to 15

That makes 250 with some folders having 4 digits?

CleverCat

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

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.

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?

aCkRiTe

  • Honorary Member
  • Joined in 2007
  • **
  • default avatar
  • Posts: 21
    • View Profile
    • Donate to Member
Re: Create Multiple Empty Numbered Folders
« Reply #8 on: January 10, 2009, 02:23 AM »
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

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 1,164
    • View Profile
    • Donate to Member
Re: Create Multiple Empty Numbered Folders
« Reply #9 on: January 10, 2009, 06:14 AM »
Awesome - works a treat!

A big thanks to all for the input!  :Thmbsup:

by66

  • Participant
  • Joined in 2008
  • *
  • Posts: 1
    • View Profile
    • Donate to Member
Re: Create Multiple Empty Numbered Folders
« Reply #10 on: February 03, 2009, 11:58 PM »
Try this program, very powerfull
Flexible renamer

 ;D