Question:
Does anyone know how I can create a batch file which creates folders in a certain directory with the incremental name of “Problem 1”, “Problem 2”, …
Answer:
Sure, like so (if it’s in a batch file):
1 2 |
for /l %%x in (1, 1, 100) do mkdir "Problem %%x" |
Or just simply on the command line:
1 2 |
for /l %x in (1, 1, 100) do mkdir "Problem %x" |
See here: Batch script loop
If you want to do it in Powershell it’s a simple one liner like so:
1 2 |
for($i = 1; $i -lt 100; $i++) { md "Problem $i" } |
or
1 2 |
1..100 | ForEach-Object{md "Problem $_"} |