How to rename the extension of all files within a folder, including subfolders
Suppose you need to rename a file's extension from one extension to another, such as jpg to png. It's easy, of course! But what if you have multiple files whose extensions need to be changed? Or worse, what if these multiple files are also located in multiple folders and subfolders, within a single folder? Well, for a normal person, this can be a nightmare. But for a geek, absolutely not. The question now is, are you a geek? Well, with the help of geekspage, you definitely are!
In this article, we explain how to easily rename the extension of all files within a folder, including subfolders of your choice, from one extension to another through a batch script method.
NOTE: Please note that in this example we have converted the JPG file to a PNG file. You can do other extension renaming such as .mod to .mp4 etc.
Rename the extensions of all files in the folder
Step 1: Click the Search icon on the taskbar.
Step 2: In the search bar, enter notepad, then select from BEST MATCH SECTION CLICK NOTEPAD APP.
Step 3: When the Notes application opens, copy and paste the following code snippet into it.
@ECHO OFFPUSHD .FOR /R %%d IN (.) DO (cd "%%d"IF EXIST *.from_extension (REN *.from_extension *.to_extension))POPDNote: Please replace
from_extension> with the old extension and
Step 4: Once completed, click the File tab at the top. Then click on the Save as option.
Step 5: In the "Save as" window, navigate to need to change the extension The folder where the file named is located.
Now, give your script file a name. I have given the name jpg_to_png.bat. You can provide any name, but the extension should be .bat.
Now, select Save as type as All files.
Click the Save button when finished.
Step 6: Next, go to the location where the batch file is saved. This is the folder that contains all the jpg files. This folder can contain subfolders with jpg files. All jpg files in all subfolders will now be converted to png.
Double-click the batch file to execute it.
Note: Please note that before executing the batch file, the file type is JPG.
Step 7: After execution, you can see that the file type changes to PNG.
Step 8: If you go into subfolders and subfolders of subfolders, you can see that the file extensions inside also change became a PNG.
That’s all. Now you can successfully change the extension of multiple files from one extension to another with just one click.
The above is the detailed content of How to rename the extension of all files within a folder, including subfolders. For more information, please follow other related articles on the PHP Chinese website!

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Dreamweaver Mac version
Visual web development tools

VSCode Windows 64-bit Download
A free and powerful IDE editor launched by Microsoft

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Safe Exam Browser
Safe Exam Browser is a secure browser environment for taking online exams securely. This software turns any computer into a secure workstation. It controls access to any utility and prevents students from using unauthorized resources.

Dreamweaver CS6
Visual web development tools
