21 February 2016

2 Creative Ways to Rename Multiple Files at Once in Windows

1 comment
Rename multiple files at once in Windows

Sometimes we need to rename multiple files at once. This is quite normal in case of images. Almost all cameras from DSLR to mobile phone creates awkward file name like this - "DSC2016_021.JPG". Actually all automatically generated files are named sequence wise. But what if you wish to change them to own name and that too without using any third-party application.

Of course, it would be a time-consuming task to rename them one by one but don't worry. Today I will guide you how to rename these multiple files at once in windows. There are number of methods you can use but here I will explain only 2 easiest methods. First one is by using windows explorer and in second one, we will be using command prompt. Now lets start it!

1. Using Windows Explorer

This is one of my favorite method and it will hardly take your 1 minute only. Isn't that cool? Hm. Before moving to the steps, collect all the files you want to rename and paste them in new folder. After this, follow these steps -
  1. First of all, select all files by using "CTRL+-A" keyboard shortcut key. Alternatively, you can mark them using your mouse.
  2. Now right-click on first file name.
  3. From menu list, click on "Rename" option.

     Rename option in Windows Explorer

  4. Now type the new file name you want to change and hit ENTER button.
This will automatically rename all your files with same name like test (1), test (2), test (3) and so on.

Comparison between original and renamed files

One more important thing is the sequence in which files are renamed. All files will be renamed one by one in the same order as they were arranged, no matter what their extension type is. For example, if "blog.jpg" comes first to "vivek.png" then the order will be test (1) and test (2) respectively. However, if you want to change this order then rearrange all files by sorting them on the basis of alphabets, format type, size etc., Still don't get it? Ask me in comment box!

2. Using Command Prompt

Being programmer I love to play with windows command prompt. Few days back, I was searching cmd help section and by a chance I found this awesome command named as "ren". This command let you rename any file along with its extension. Unfortunately, it's a tedious task but I am sure that you'll learn something interesting.

Now let me explain you the basic logic behind this tricks. First of all, we will address the command prompt to the location where all files are located. After that, we will use wildcards along with ren command to change file name and its format type. So basically, it is two-step process.

The quickest way to open command prompt at your desired location is to press and hold shift button and then right-click on folder blank space and select "open command window here" option.

Open command windows here option

Alternatively, you can open cmd.exe from start menu and then execute this code to move it to your folder location.

cd "your folder location here"

For example - cd c:\users\username\desktop\vivek

This will move your command prompt to vivek directory. Now we will use ren command and wildcards. The basic syntax for ren command is - ren originalfile renamedfile

For example - ren *.png testing?.jpeg

ren command syntax

Here asterisk (*) is a wildcard which means that it can be replaced by any word, number, symbol or combination. This will select all files no matter what their name and character length is. ".png" will select all png format images while "testing" and ".jpeg" will create a new file name and format type respectively. Question mark (?) is another wildcard which here is used to add same single character from original file name.

Above command will rename all files like - testing1, testing2, testing3 and so on. I am not sure that it will work for you. Sometimes, it can display an error message as "A duplicate file name exists, or the file cannot be found". Though In most cases, it will work. Make sure that all your file names have more than 6 characters which are not identical in any way. See below picture to study all changes.

Comparison between original & command prompt renamed files

As like in first method, this will not add any (1), (2), (3) as a suffix to any file name. This is the main problem here and that's why I had used question mark wildcard. It will inherit single character from original name as a suffix and thus all files will have a different name. However, if there is a conflict between two file names then it will display an error message as discussed above.

You can also change above command as per your own requirements. Moreover, if you know the correct use of other wildcards then you can use them to target more specific files.

As I said before, this method is very confusing and you may find it hard to solve more complicated patterns. Especially if you're a newbie. So I highly recommend you to use first method but if you want to change multiple extension types at once then use this method.

Now its your turn to try this. Interesting news is, In my upcoming tutorials, I will teach you how to create a batch file which can be used to rename multiple format types at once. So stay tuned and keep rocking!

1 comment:

  1. Long path error!
    "Long path tool" is very helpful for this problem. You can solve this problem like copy, delete, long path files by using this tool.
    I used to have similar problems too, but after using "long path tool" everything was solved.