Home>

Need to decide:

My directory: C: \ Test

write a batch script that creates 3 folders embedded one in Other.

Top-level folder with name 1, the folder with the name 2 is invested in it, and It is a folder named 3.

To solve the cycle implemented using the operator unconditional transition -Goto, as well as a condition limiting the number of cycle iterations (so as not to the folders more created than required).

There is such a solution:

Label1
Increment SomeValue.
Mkdir Dir {SomeValue}
CD Dir {SomeValue}
IF SomeValue <
3 Goto Label1

Use% Random% for the name, and create nesting by adding a folder to the path? Set Mypath=% Mypath% /% Random%

kotleni2021-09-16 16:13:09

Use name for example Name1, Name2, Name3

mksmbbk2021-09-16 16:14:03

Try it: SET /A Counter=% Counter% + 1

kotleni2021-09-16 16:16:33

Nothing happens

mksmbbk2021-09-16 16:35:34

Use a random number if you do not want to continue to mess with it. (wrong answer)

kotleni2021-09-16 16:37:18
cmd