08/20/2019 windows | for beginners | programs
Sooner or later, almost every user is faced with the fact that he needs to bulk rename a group of files: sometimes the task is simple - for example, you need to give them names with numbers in order, sometimes it is more complex: for example, you need to change the names of a group of files in such a way so that they have a number, creation date, and any additional information in the name.
All this can be implemented in one form or another; for some scenarios, the built-in tools of Windows 10, 8.1 or Windows 7 are sufficient; sometimes it is better to use special programs for bulk renaming of files and folders. Both methods will be discussed in this manual. By the way, functions for renaming a group of files are included in a set of useful Microsoft PowerToys utilities for Windows 10.
- Advanced Renamer is a free program for advanced bulk file renaming
- Renaming a group of files using Windows
- Bulk renaming of a group of files in Total Commander
- Video instruction
Advanced Renamer
Advanced Renamer is a free program for bulk renaming files and folders using customizable templates that can do a lot once you get the hang of it. It is available on the official website in Russian both as an installer and a portable version (ZIP archive that does not require installation). Here's an example of using Advanced Renamer to mass rename a group of files:
- There is a folder of photos (but the method is also suitable for any other types of files) taken at the same time, but on different devices (camera and smartphone). Some have the date and time as a name without spaces, and some have the number of the picture taken by the camera. In this case, the file name and file extension from the camera are written in uppercase. The task is to bring the names of a group of files into a convenient form.
- Launch Advanced Renamer, then either drag the files to be renamed into the list in the center of the interface, or click the “Folder Panel” button, find the folder with the required files and click the “Add” button. A window will open where you can set the adding parameters: in my case, I leave everything as it is: I need to rename all the files.
- The next step is to click “Add method” in the left panel and select “New name” (other methods are also possible, more on them later) to determine exactly how the files will be renamed. This is where the fun begins. As new file names, we can use tags predefined in the program, which make it easy to substitute the necessary information into new file names. If necessary, you can click "Tag Help" to get more detailed information (albeit in English) on the official website. But just from the brief description of each tag it should be approximately clear what exactly they mean. For example, if in the “New name” field in the method settings I enter: photo—-.jpg, then I will get file names like photo-increasing_number-day_of_shooting-month_of_shooting-year_of_shooting.jpg Moreover, the shooting date will not be taken from the file modification date (which can also be done), but from EXIF data recorded by the camera.
- To prevent files from getting a double extension, when changing it, in the “Apply to” field, you need to select “Name and extension”, and not just “Name”. If you are not changing the extension, leave this option at its default value (in this case, the rename pattern will not apply to file extensions).
- You can see what file names you get after renaming right away on the central tab of the program even before starting the mass renaming process.
- To get started, just click the “Run” button and confirm the start of the renaming. If you need to not just rename, but copy or move files to another location, select the appropriate item in the “Batch mode” field at the top of the program window.
- As a result, we get a group of files renamed according to the template we specified.
The added methods (renaming templates) are saved in the program, and you can select the one you need at the right time. By right-clicking on the name of the template, you can change its description, for example “For photos”, “For archives” and whatever else you like. Templates that do not need to be used during the current renaming process can simply be unchecked.
Also, when renaming, you can use not just a single template, but several at once (we mark the corresponding templates, and they will be applied in the order in which they are located in the “Renaming methods” column): for example, the first one changes the name, the second one changes the case in the file name, the third — removes “junk” characters from the file name (for this we use the “Replace” method).
I have given only a simple example of using the program, but it can do much more: for example, you can save a template file, and then start renaming the desired group of files according to the desired template from the command line, import a list of files and new names from CSV tables, bulk change file attributes, set random file names, optimize names for use on the web (or turn Cyrillic into transliteration), use EXIF information, ID3 tag data, video, GPS and more.
To get acquainted with some ready-made templates, you can click the “Open” button in the renaming methods and see one of the 4 predefined templates in Advanced Renamer and how exactly they are arranged.
You can download Advanced Renamer from the official website https://www.advancedrenamer.com/. Note: in my case, when downloading an archive with the program, Windows 10 Defender reported a threat in the file. However, VirusTotal reports that it is completely clean.
Renaming a group of files using Advanced Renamer
Another multifunctional program, which, judging by the name, provides “advanced” management of system changes in file names. Its strength is the ability to use many templates already installed in memory, and, as a result, an increase in options for mass renaming methods. The program is distributed absolutely free of charge. How to work with it:
- Download, install and run the program. When you first start it, you will be asked to select a language from the list, which will also include Russian.
- You can add all the necessary files or folders to the work list from the menu item with the appropriate name. This way you can rename the contents of several sources according to one system.
- On the left side, you need to click “Add method”, and then select the required template from the drop-down list, for example, “Renumbering”. Methods can be combined and customized at your discretion. The right side of the window displays the new name that each file will have when saved.
- After all the necessary manipulations are completed, all that remains is to press the “Run” button or the F9 key to start renaming files.
Renaming a group of files using Windows 10, 8.1 and Windows 7
Windows Explorer, Command Prompt, and PowerShell can be used to bulk rename files, and some simple tasks are quite doable using these tools (and if you know how to write PowerShell scripts, the range of tasks you can do becomes noticeably wider). Below are examples of renaming in each of the specified system utilities.
Renaming multiple files in Windows Explorer
First, about simple manual renaming in Explorer: you can select the file, and then select “Rename” from the context menu. It will be even faster to press F2 after highlighting the file. Not everyone knows, but if you press the Tab key after entering a new file name, renaming the next file in the folder will automatically begin.
Another option, suitable for little, but it makes sense to know about it: select several files in a folder in Explorer (with the mouse, or holding Shift while selecting, or holding Ctrl and clicking on individual files with the mouse). After this, press F2 (or select “Rename” in the context menu) and enter the name for the file whose name will begin changing. Press Enter when finished.
As a result, all files will have the same name, but after each name, a sequential number will be indicated in parentheses, as in the screenshot.
Command line renaming options
The Command Prompt also allows you to rename a group of files using the standard ren command (for beginners: How to start the Command Prompt).
Examples of using a command to rename a group of files, using which you can create your own command:
ren *.jpg *.jpeg
As a result of execution, all files in the current folder (in the screenshot selected by the command cd path_to_folder) with the .jpg extension will acquire the .jpeg extension. The star icon in a command can replace any set of characters (either one character or several at once).
ren *.jpeg ?????.jpg
The specified command will change the extension of all files in the current folder from jpeg to jpg, and will also shorten their names to the first 5 characters. A question mark in a command means any one character. The command may generate an error if the first five letters of the names of two or more files are the same.
ren * file-*.old
The command will rename all files in the folder without exception and bring them to the form: file-old_file_name.old (the old extension will disappear).
Bulk renaming files in PowerShell
Another Windows tool that can be used to bulk rename files and folders is Windows PowerShell. The fastest way to launch it is to use the search in the start menu (taskbar) or, if you have Windows 10, right-click on the Start button and select the desired menu item from the context menu (Other methods: How to launch Windows PowerShell).
PowerShell has a Rename-Item command for renaming files, which can be used in much the same way as the ren command at the command line when working with a single file, but because PowerShell allows commands to be used with others, rename-item is more powerful. A few examples:
Get-ChildItem -Path *.jpeg | Rename-Item -NewName {$_.name -replace ".jpeg",".jpg"}
This will change all .jpeg file extensions to .jpg in the current folder.
Get-ChildItem *.jpg | Rename-Item -NewName { $_.Name.Replace(' ','_') }
The command above will replace all spaces in .jpg file names in the current folder with underscores.
Get-ChildItem | % { Rename-Item $_ "Secret File $_" }
Each file name will have "Secret File" and a space appended to the beginning.
Get-ChildItem *.* | ForEach { Rename-Item -Path $_.FullName -NewName "$($_.DirectoryName)\$($_.BaseName)_$(Get-Date -F dd-MM-yyyy)$($_.Extension) » }
Each file name will be appended with an underscore and a date in Day-Month-Year format.
How to Rename Multiple Files at Once Using PowerShell
Compared to the Command Prompt, PowerShell provides much more flexibility when renaming a large number of files. Open the folder that contains your files, hold down the Shift and select Open PowerShell Window Here .
First, let's look at the process of renaming one file using the following example:
rename -item “file.extension” “new name.extension”
Easy enough, but renaming one file through PowerShell is a very strange thing, so let’s move on to group renaming. Let's look at this command as an example:
dir | rename-item -NewName {$_.name -replace “ ”,”_”}
dir command collects all the files in a folder and "attaches" them to the general rename command rename -item . Next $_. name means that you need to change the name for each file in the directory. — replace tells the system that one part of the name should be replaced with another. The text in the first quotes is what needs to be removed, and what you put in the second quotes will appear in place of the deleted text.
This particular command removes spaces from file names and replaces them with underscores. Having learned how this command works, you can easily change file names in batches, without having to play with each file separately. Of course, you can add additional arguments that will complicate the renaming and make it more specific, but for this you will need to study in more detail the list of existing commands in PowerShell. If you know them, then most likely there is nothing for you to do in this instruction.
Bulk renaming of files in Total Commander
Many users use Total Commander to work with files on disk. There are also group renaming options in this program; it is implemented very simply:
- Select the required files (use Shift and keyboard arrows, right-click, Ctrl+mouse selection).
- Press Ctrl+M or select “Batch file renaming” from the “File” menu.
- Set renaming options in the “File name mask” section, using the suggested masks, replacements, case changes, counter, and options from the “Plugins” section. By changing the options, in the preview window you will immediately see exactly what the already renamed files will be called. To change the extension, use the “Extension Mask” field.
- In the example above in the screenshot, the set of files will be renamed to Photo- followed by the addition of a three-digit counter and the creation date in the format DD-MM-YYYY (available in plugins), the extension will be changed to jpeg, and the file name will be converted to lower case.
At first, using the bulk rename utility in Total Commander may seem complicated to some, but if you figure it out a little, I’m sure the tool will become useful and convenient.
Renaming files with third-party programs
One of the most common options is renaming using Total Commander.
Open this program and go to the folder we need.
We have two options depending on what we want to do. If you, like me, are only interested in changing the extension of selected files located in a specified folder, then the first of those described below is more suitable for you; if you need a more tricky renaming, then it is better to turn to the second option.
Option 1. Simple change of extensions for folder files
On the right side of the window shown in the picture above, we also go to the folder in which you need to change the file extension.
Use the Insert button to select the required files or press the Ctrl + A key combination to select all files and press the F6 button. The following window will open:
At the end of the first line in *.* it is necessary to replace the last asterisk with the extension to which we need to replace the extension of existing files, in my case *.txt.
Click OK, the extensions of the selected files have been replaced.
If we need a more clever renaming, then we can try option 2.
Option 2: Bulk file renaming
Also in the Total Commander window, select the folder we need. Then use the Insert button to select the files we need or press the key combination Ctrl + A (Select all), then Ctrl + M, a group renaming window will open:
As in the figure above, in the “Search and Replace” area in the “Find” field we write jpg, in the “Replace with” field we write txt. Click “Run” and enjoy the result. Until the first bummer. We must understand that if we follow this path, then if the file was called, for example, jpg.jpg, it will be replaced with txt.txt. Fortunately, this window has a “Rollback” button (who?!). So this type of renaming is suitable if we need, for example, to add a counter to the file name. To do this, click the [C] button in the upper left part of this window and look at the preliminary result. The field “Mask for: file name” should contain [N][C]. To separate the counter from the main file name, you can write in this field, for example, [N] ([C]). In the “Counter Options” area, you can specify which digit to start counting from, in what increments, and how many digits should be displayed. This is what you get:
In the same way, we can add a date to the file name ([YMD] Date button), time ([hms] Time button)), separating them for our own convenience with some symbol, for example, a dash.
Particular attention should be paid to the advanced features, namely adding many other parameters to the file name by selecting the ones you need from the drop-down menu when you click on the “[=?] Plugin” button.
In the file name mask line, you can set the desired name format, for example, only the time the file was created in this folder:
The simplest options were discussed above. You can search for files using a regular expression. To do this, in the “Search and Replace” area, check the “Reg. express.”, in the “Find” field we write our regular expression, and in the “Replace with:” field we write what we will replace everything found with. My example uses the simplest regular expression \d, which looks for numbers in the file name and replaces them with the letter a. Please note that the file called test.JPG is not involved in the replacement process, since there are no numbers in its name!
The advantages of this solution:
- For simple tasks - a very simple solution that does not require any special knowledge. You don't need to know about any cmd.
- Quite powerful functionality for various types of tasks
- There is a preview, it is clear what will eventually be done with the file names
- There is an opportunity to roll back if something goes wrong
Disadvantages of this solution:
- If you have Total, you won’t lose it, you won’t download it! If Total Commander is not on your computer, you need to install it.
- Judging by the screenshots, it’s not for me to say, of course, but Total Commander is still not free, so if your company treats software purchases with trepidation, then it’s better to either buy it or look for a free alternative.
Let's look at a couple of these alternatives.
Among the free alternatives to Total Commander, I would like to highlight Double Commander. Everything described above is wonderfully done in it, from simply replacing the extension to searching for a file by name using a regular expression. At the same time, if you are familiar with Total Commander, or at least are guided by the screenshots given in this article, then you will notice that the program interface is very similar and understandable. By the way, it is Russified, which is very important for many. Yes, of course, its functionality is reduced in relation to its “big brother”, for example, it is impossible to calculate the checksum of a CRC32 file, and it is also impossible to synchronize directories, you can only compare. But the functionality of adding a comment to a file using Ctrl + Z is preserved. Files can be searched not only by name, creation date, but also by content. True, after the file is found, it can only be edited; double-clicking it does not open, which is strange... You can find the file on the network using the drive called \\ at the top of the program or by clicking on the menu item “Open VFS list” . I would especially like to highlight the presence of its own built-in test editor with the ability to select encoding and even syntax highlighting!
The FreeCommander XE program has similar functionality, it is also Russified. Its interface is not at all as boring as that of the previous two programs; changing the file name is also very similar to what is presented in the previous two programs. However, the search using a regular expression let us down. But I think this is not the most popular functionality in Total Commander either. It is possible to synchronize folders and compare them. Here the program has a clear advantage. The program provides the ability to connect a network drive. In general, judging by the menu item Tools -> Reassign Win + E for FreeCommander, the program is very ambitious. Doesn't know how to calculate checksums, with the exception of MD5, doesn't know what a file comment is. By pressing F4, it opens the editor specified in the system by default, that is, it does not have its own built-in one. The search is also carried out both by file properties and by content, and by double-clicking the file opens in the standard program specified in the system. This is a definite plus!
PS In the FreeCommander program there is a menu item File -> “Destroy”... When I looked at it out of the corner of my eye, I thought that, judging by the icon, it was a seal, which is somehow strange O_o. I looked at the key combination Shift + Ctrl + Del, apparently, it really is destruction... Ah-ah, this is not a printer, but a shredder! That's it =)
So think, decide whether to have Total Commander or not!
Using standard Windows tools
Changing file names
Let's consider the simplest case: we have the nth number of images with meaningless names.
Let's reduce the names of these files to the visual form Picture (n), where Picture is the name, and n is the serial number. This can be easily done directly in Explorer.
Select all the pictures that we want to rename. To do this quickly, use the key combination Ctrl + A. Then simply press F2 or right-click on the first file and select “Rename”. As the name for the selected image, enter the word Picture and press Enter.
Windows will automatically assign the same name to all subsequent files and assign all serial numbers.
If necessary, you can cancel mass renaming with the Ctrl + Z key combination.
If you want to rename a group of folders in Explorer, you can do it in the same way.
- How to rename files all at once
Changing file extensions
Let's say we have several text documents that, after double-clicking, open in Notepad. But we need them to be opened by the browser by default. To do this, you will have to change their extension from .txt to .html. These types of operations can be quickly performed using the command line.
Press the Windows + R keys, enter cmd in the field that appears and click OK - we see the command line window. Now we paste into it the path to the folder in which our files are located, immediately after the cd command: cd C:UsersMax VolotskyDesktopDocs, and press Enter. Then we use a special command that will change their extensions: rename *.txt *.html, and press Enter again.
The first extension in the command is the original extension, the second is the new one. After entering the command, the system instantly makes changes.
To return everything as it was, you need to use the rename command again, swapping the extensions.
Total Commander
In addition to standard renaming, you can use a popular program link called Total Commander. Maybe someone remembers the old Norton Commander environment, which was used in our country even before the introduction of windows? Yes, such a shell with directories and files, divided into two sections. Damn, I was so nostalgic. Back in 1990-1993, I loved going to my father’s work to play on the computer, and I had to do everything through Norton Commander. Damn, you need to stop me, otherwise I’ll go back to childhood.
So, for Windows there is a similar environment, but only already made for a modern interface - Total commander. And by the way, it is quite convenient to work in it, in addition, it has a number of useful functions. But I won’t teach you how to use it today, since this should be a separate topic. But there is one caveat. It's paid. But you are given a month to work in it for free.
Today we will use it to bulk rename files.
- Download it, for example from here and install it. The installation is completely standard and simple. Just download the version for your system bit size. Which one do you have - 32 or 64? You can view this information by right-clicking on the “computer” icon and selecting “Properties”.
- Enter the program and you will see an interface divided into two windows. Find your folder where all those files are located that could use a name change.
- Now select all the files. This can be done using a familiar combination CTRL+A or in the main menu at the top, select “Select” and then “Select All”. As you can see, all your files in the folder are highlighted in red. If this is the case for you, then well done. And if it doesn't work, try again. Anything can happen.
- Now find “Files” in the main menu and select “Group rename” from the drop-down list, or press the key combination “CTRL + M”.
- Now the group renaming window has opened in front of you. Scary? No need. There's nothing wrong with that. Here you are invited to look and choose on what basis to rename files. For example, you can select by date, then each file will be renamed according to the modification date. But I don't like that. It is best to use "Counter". In this mode, files will be renamed starting from one and in order. But that's the default. And by the way, don’t forget, if you want a certain word (for example, a photo) to appear in front of the counter, then you need to enter it into the “mask”.
- And if you want to set something of your own, then you need to pay attention to the parameters that are located in the upper right corner of the program window. By default everything is set to «1». Those. the first file will be renamed to 1, and then in order - 2, 3, 4. But we can put not only numbers, but also letters, as counting symbols (True, only Latin ones). To do this, change “Start with. " on "a" (Latin). Then the next file will be called b, and then the next one c, well, you understand. You can also change the renaming step. The default value is 1, i.e. the following letters and numbers will be in alphabetical order. But if you put a step - 2, then they will already go to 1,2,3 or a,b,c, but they will be like 1,3,5 or a,c,e. Did you understand? One letter or number will be stupidly skipped.
- In general, here you can see all the parameters yourself. It's easy to understand. But when you have configured everything for yourself, do not forget to click the “Run” button. After all these manipulations, the files will be renamed in a second and will take the desired form.