This will create 10 folders with random
names and 1 file within each folder with random
names.
This will create a completely empty file in the created directories:
@echo off
setlocal enabledelayedexpansion
for /l %%i in (1,1,10) do (
set tempf=!random!
mkdir !tempf!
copy /y NUL !tempf!\!random! >NUL
)
Increasing/Decreasing the 10
in for /l %%i in (1,1,10) do (
will increased the number of folders and files. To add more files to folders, repeat echo nul > %random.txt
or simply create another loop to create multiple files in the folders.
fsutil
is a another option, but requires admin privileges, it will create a nul variable in the file.
@echo off
setlocal enabledelayedexpansion
for /l %%i in (1,1,10) do (
set tempf=!random!
mkdir !tempf!
fsutil file createnew !tempf!\!random! 1
)
This creates a new file, with some text, in this case the word nul
will be written to file, but you can change that:
@echo off
setlocal enabledelayedexpansion
for /l %%i in (1,1,10) do (
set tempf=!random!
mkdir !tempf!
echo nul > !tempf!\!random!
)