-2

In windows explorar we can select multiple files in a folder and rename them sequally, but I want to do the same thing with batch skript

change this

     A.mp4
     B.mp4  
     C.mp4
     DD.mp4 

to this

     (1).mp4
     (2).mp4   
     (3).mp4
     (4).mp4   
Robin
  • 1
  • Not tested a single command line version: `@set "FileNumber=1" & @for /F "eol=| delims=" %%I in ('dir *.mp4 /A-D /B /ON 2^>nul') do @set "FileName=%%I" & @setlocal EnableDelayedExpansion & @ren "!FileName!" "(!FileNumber!).mp4" & @endlocal & @set /A FileNumber+=1` Questions like your once are asked and answered already multiple times. So please use the Stack Overflow search at top, for example with [\[batch-file\] increment* number file name](https://stackoverflow.com/search?q=%5Bbatch-file%5D+increment*+number+file+name). It is not possible to write a multi-line code in a comment. – Mofi May 26 '21 at 12:35
  • use a renaming tool, see the examples: https://github.com/75lb/renamer – Lloyd Jun 03 '21 at 09:09

1 Answers1

0

Try this instead:

ren C:\Path\beforefilename.mp4 afterfilename.mp4

Example:

ren C:\Path\A.mp4 (1).mp4

Result is Filename A.mp4 changed to (1).mp4

Loppt2009
  • 1
  • 1