none
making multiple copies of a file RRS feed

Ответы

  • If you're just trying to append a sequential number to the end of the file name you could use this :

    for /L %%i IN (1,1,10) do copy text.txt text%%i.txt

    which in this example will copy text.txt to text1.txt, text2.txt etc through to text10.txt.

    The bit in brackets controls the start value, the increment and the end value, and then you simply adjust the bit at the end to relate to the filename you're renaming.

    • Предложено в качестве ответа FZB 27 мая 2014 г. 21:08
    • Помечено в качестве ответа arnavsharmaModerator 4 июня 2014 г. 9:53

Все ответы

  • If you're just trying to append a sequential number to the end of the file name you could use this :

    for /L %%i IN (1,1,10) do copy text.txt text%%i.txt

    which in this example will copy text.txt to text1.txt, text2.txt etc through to text10.txt.

    The bit in brackets controls the start value, the increment and the end value, and then you simply adjust the bit at the end to relate to the filename you're renaming.

    • Предложено в качестве ответа FZB 27 мая 2014 г. 21:08
    • Помечено в качестве ответа arnavsharmaModerator 4 июня 2014 г. 9:53
  • if you run Keith's command directly from the command line, only use one %, if you save it inside a batch file and run that, you need the %%
  • Thank you, worked perfectly on Windows 7 with one "%"
    22 июня 2019 г. 17:34
  • Thanks worked great.  If I wanted 1 to 1000 starting at 001, 002, etc.... can the %i value be formatted?  I suppose I could go from 1000 to 1999 if lexicographic order was what I was after.  I know ordering in Winows can be controlled  (numerical vs. literal) but that doesn't always help if opening the folder from another application.  Thanks again!
    22 июня 2019 г. 17:50