Mass Folder Creator (Much Improved) 09-30-2012, 02:19 AM
#1
Code:
@ECHO OFF
SETLOCAL ENABLEDELAYEDEXPANSION
set /a count=10
set /a buffer=1000
if [%1]==[] (
set /a i=0
:cont
if !i! lss %count% (
set /a val=!i!*!buffer!
start cmd.exe /c %0 !val!
set /a i+=1
goto :cont
)
exit
)
set /a c=%1+!buffer!-1
for /l %%G in (%1,1,%c%) do (
md f_%%G
)
goto :eofWhat this does is create 10 * 1000 (buffer * count variable) folders, except it's much faster because you have several batch files running at a single point in time creating each range of 1000 (buffer) folders.
So here, we have in this example 1 batch script running to create folders 0-999, another for 1000-1999, and another for 2000-2999, etc... So that we result in 0-9999 folders, which is exactly 10 000 folders because we include 0 as a folder.
It does this by starting a new instance of itself to run, with custom/modified arguments each time for where to begin and leave off with creating folders; ranges.
ArkPhaze
"Object oriented way to get rich? Inheritance"
Getting Started: C/C++ | Common Mistakes
[ Assembly / C++ / .NET / Haskell / J Programmer ]
"Object oriented way to get rich? Inheritance"
Getting Started: C/C++ | Common Mistakes
[ Assembly / C++ / .NET / Haskell / J Programmer ]
![[+]](https://sinister.ly/images/modern/collapse_collapsed.png)
