auto folder create bash script

______________________________________________________________________________

:ar

md %random%

goto ar

________________________________

Explanation:

  1. :ar

    • This is a label in a batch file. Labels are used as jump points for the goto command.

    • :ar is the name of the label here. You can jump to it using goto ar.

  2. md %random%

    • md stands for "make directory" (alias for mkdir), used to create a new folder.

    • %random% is a built-in environment variable in batch scripts that returns a random number between 0 and 32767 each time it's called.

    • So this line creates a directory with a random name like 12345, 30294, etc.

  3. goto ar

    • This causes the script to jump back to the :ar label, creating an infinite loop.

    • Every time it loops, it creates a new directory with a new random name.


What this script does:

It infinitely creates folders with random names in the directory where the script is run. If left running, it will:

  • Fill up the screen with random folder names.

  • Potentially fill the drive if not stopped, because it's endless.


⚠️ Warning:

This script can quickly clutter your system with thousands of randomly named folders and might slow down or even crash your machine if you run out of disk space.

________________________________________________________________________

 @echo off

set count=0

:ar

if %count%==10 goto end

md %random%

set /a count+=1

goto ar

:end

echo Done!

pause

______________________________________

This version will stop after creating 10 folders.

or you can change number of folders you require

_____________________________________________________________________

Comments