Как обработать в пакетном режиме, создают диапазон папок (000-999) в окнах?

Я должен создать 1 000 папок, пронумерованных 000 к 999 внутренней части каталог. Как я могу сделать это использование cmd (т.е. командная строка Windows)?

16
задан 19.02.2016, 00:24

1 ответ

for /l %i in (0,1,9) do md 00%i
for /l %i in (10,1,99) do md 0%i
for /l %i in (100,1,999) do md %i

Объяснение из документации (т.е. тип for /? в командной строке):

Runs a specified command for each file in a set of files.

FOR %variable IN (set) DO command [command-parameters]

  %variable  Specifies a single letter replaceable parameter.
  (set)      Specifies a set of one or more files.  Wildcards may be used.
  command    Specifies the command to carry out for each file.
  command-parameters
             Specifies parameters or switches for the specified command.

...

FOR /L %variable IN (start,step,end) DO command [command-parameters]

    The set is a sequence of numbers from start to end, by step amount.
    So (1,1,5) would generate the sequence 1 2 3 4 5 and (5,-1,1) would
    generate the sequence (5 4 3 2 1)
26
ответ дан 07.12.2019, 10:52

Теги

Похожие вопросы