Thursday, 29 August 2019

windows - How do I rename a bunch of files in the Command Prompt?


I have a problem with filenames. The stupid camera I am using resets the autonumber sequence every so often, and therefore I am getting tons of conflicts if I try and put lots of photos in a single file.


I know there is a way to rename them all to something like the following:


1.jpg, 2.jpg, 3.jpg . . . 2000.jpg, etc...


Unfortunately, I am among the generation who never really used DOS much before Windows came out with all its fake gimmicks. I have tried finding an app to do this, but they are quite pathetic, so I want to just do it in either the Windows .cmd or just a plain .bat (that's where I found some decent control over files). Can anyone help me out with the code?



Answer



I've been loving the command line since the mid 80's but I have to admit this is one area where I always rely on Rename-It! I know you want DOS but I'll leave this one just in case someone stumbles through that hasn't heard of it.


During times when I needed extreme control over individual files (usually in groups) I have used a spreadsheet to build the batch file. In this case I use DIR/B to collect file names into a text file, paste them into one column, build the renaming command in a final column (D in this case) then paste that column into a .BAT file and run it.


enter image description here


No comments:

Post a Comment

How can I VLOOKUP in multiple Excel documents?

I am trying to VLOOKUP reference data with around 400 seperate Excel files. Is it possible to do this in a quick way rather than doing it m...