- Change File Extension On Multiple Files
- Change File Extension
- Change File Type
- Change File Extension Python
Nov 02, 2017 Add the target files/ folders from the Step 1 section. In the Step 2 drop-down menu, select New Name. You will notice another drop-down menu that just popped up just below the Name textbox in Step 2. Click that drop-down. Now type in the new extension of your choice in the Name textbox. A file's extension (the letters appearing after the period in a filename, such as 'txt' in 'details.txt') tells a computer what type of file it is and what type of program should be used to open that file. If a file has an incorrect extension, you may be unable to open it. It's relatively easy to change the extension on a PDF file on both a Mac.
TipAlthough any file can be renamed, it doesn't mean that, after it is renamed, it can be opened with any program. For example, you can rename a .BAT to a .EXE, however it will not run because a .EXE file is a compiled file. If you want to change the file type, it must be converted or saved as the destination file type, with the appropriate file extension.
Below is a listing of how to change the file extension for each of the major IBM compatible operating systems.
Windows users
Before renaming a Windows file extension, you must have show file extensions enabled. By default, this option is disabled.
Assuming the file is named myfile.txt, we rename it to myfile.doc.
- Right-click the file (not the shortcut).
- Select Rename in the menu
- Erase the .txt from myfile.txt.
- Type .doc (it is important to have the dot to separate the file name and file extension).
Renaming multiple file extensions
If you want to rename or change the file extensions of multiple files, we recommend you enter the Windows command line and follow the steps below.
MS-DOS and Windows command line users
Open an MS-DOS or Windows command line.
Change the directory to the location of where the file is located. In our example below, we rename the file myfile.txt to myfile.doc.
Unless the file already exists, no message is displayed or an 'OK' message indicates the file was renamed.
- See the move command page for more information about this command.
Renaming multiple file extensions
![Extension Extension](/uploads/1/1/9/8/119875533/565473969.jpg)
![Change Change](/uploads/1/1/9/8/119875533/608000028.gif)
If you want to rename multiple files that have the same file extension without the aid of a different program, we recommend you follow the steps below.
The example below we rename all the files in the current directory that end with .txt to .old.
- See the ren or rename command page for more examples.
In our example, we are using an asterisk as a wildcard that tells the command line that we want every file name.
Change File Extension On Multiple Files
Unix and Linux users
Change the directory to the location of where the file is located. In our example below, we rename the file myfile.txt to myfile.htm. Additionally, this example is done from the shell and not a GUI.
If the operation is successful, you will be returned to the shell prompt.
- See the mv command page for more information on this command.
Additional information
- See our file extension definition for further information and related links.
This post talks about how to batch rename file extensions from command line. No 3rd party tools are required. At the end of the post, you can find a download link for the batch file script.
Batch rename file extensions in bulk from CMD
We can change the extension of files in batch using rename command. For example, let’s say you have set of files with extension .log and you want to rename them to .txt. You can do this with the below command
The drawback with this command is, we can’t use it to rename file extensions recursively in the sub folders. Next, we’ll look at a solution which allows us to do so.
Recursively batch rename file extensions
If you want to rename files from one extension to another, recursively in all sub folders, then you can use the below command.
For example, if you want to rename all xml files to txt files, the command would be as below
Remove file extensions in batch
The below command would remove extension for the specified file types.
If you want a batch file script, it can be downloaded from the below link:
Batch file script for renaming file extensions in bulk
Batch file script for renaming file extensions in bulk
Change File Extension
Add prefix to file names in batch
Change File Type
If you want to add any prefix to file names, it can be done as in the below example. Here we try to add ‘photo’ to every jpg file in the current folder and subfolders.
Similarly, we can add a number to a file name.
Handling names with white spaces
Change File Extension Python
If the new name you want to assign to the files has white space within it, it can be done by adding double quotes around the file name. So that forfiles does not misinterpret this doublequotes, you need to escape them with ‘’
For example to add ” – pic.jpg” to each of the jpg files, the command would be as below.
For example to add ” – pic.jpg” to each of the jpg files, the command would be as below.