From time to time, I need to quickly change the file extension of all files in a folder. While there are tools that can do that for you (one of which I’ve written about previously), if you need to append the same file extension to all files in a folder, using the command line in Windows can be just as quick. Here’s how:
- Open a command line window
- Navigate to the folder where the files are located
- Enter the following command:
rename *.* *.EXTENSION(replacing EXTENSION with the desired extension):
Beware; this is a very powerful tool, and used as shown above, it will append the new file extension to all files in the folder. For those occasions where that’s what you want, though, it’s pretty useful.
In case you’re wondering why I’d need to do this, in the example that inspired this post, I had a support ticket where a user had sent me a large amount of emails as attachments to an email, which arrived with a number of file extensions, including .bin and .do. I needed to change them to .eml to open them in Outlook.