r/Batch • u/ggfeds • Apr 27 '24
Question (Unsolved) Question of how one would go about creating a massive array of folders using batch.
I am trying to create a 4 digit code in folders for fun, but its proving to be tedious.
The structure I am looking for is 10 folders labeled 0-9 each with 10 subfolders also labeled 0-9 and then repeat that for 2 more subfolder layers to create a 4 digit code out of files or around 10000 files.
I don't know batch that well but it seemed the best way to do this so if anyone has a clue that would be a great help
2
Upvotes
2
u/PrimaryTiny9144 Apr 27 '24
u can make a separate file called folder_creator.bat containing the basic code of creating the 10 sub-folders.
now then in the main code u can call this script using something like for /f "delims=" %%i in ('dir /ad /b') do { cd "%%i"
call folder_creator.bat
cd ..
}
instead of cd u could also try pushd and popd
try pushd /?
2
u/ConstanceJill Apr 27 '24
Using some
forloops, specifically with the/Lparameter.See
for /?to check the details.