How to change / rename multiple filenames or file extensions at once (Batch files 4)

preview_player
Показать описание
Batch files 4: How to change / rename the filename or file extension of multiple files at once

#batchfile #batch

Follow me on other media:

Music used:

Annotations:

Batch Files 4:

How to rename multiple files or file extensions at once

1. Changing the file extension

Using a batch file we're going to change all these .txt files to .html files

Create a .bat file (if you don't know how to do this, see my earlier video's on batch files), and type:

"@ echo off

ren *.txt *.html"

The 'ren' command stands for 'rename', and in this case, it tells your PC to change the filenames that end on ".txt" to ".html"

Doubleclick the .bat file to execute it.

All the .txt files changed to .html files!

2. Changing the filename

The asterisk (*) in the first batch file I demonstrated acts as a 'wildcard character', and means that it doesn't matter what's in front of the ".txt", as long as it ends on ".txt", it'll execute the command on the file.

The wildcard character can also be used on the end of a string, to mean that it doesn't matter what comes after the asterisk, it'll execute the command on the file.

Therefore, we can also use it to change the beginning part of a filename.

Create a .bat file and type:

ren (whatever the file starts with that you want to change)* (whatever you want it to be replaced with)* "

It works!

For more complex renaming problems, batch files are a lot more difficult to write, and it's recommended to look into alternatives, such as the "Bulk Rename Utility".
Рекомендации по теме
Комментарии
Автор

Thank you. A virus entered my computer and change almost all of my extensions to 'davda', you helped me to beat it.( This is real, no joke)

cotasamnewmanow
Автор

Sweet! This video was absolutely awesome! I was looking for this sooo long, thank you!

justinkfilms
Автор

Sweet holy moly... It worked!! Now how easy was that. Thanks

freedomphiliplachica
Автор

THANK YOU! Been looking for this all my life.

jimt
Автор

you save my day! no need to edit fileextension of multiple files!! thanks 😅

marbiewagas
Автор

Wow, Thanks dude, just changed extensions for files worth 70+ GB. Nifty trick!

crkwho
Автор

I download 1000+ plus episodes of One piece, bleach, naruto from a website with .anka extension on them, this tip literally save my life. Thank You!

CosmicDiamond
Автор

Thank you so much bro you save my time literally my life <3 muah muah

jamesraven
Автор

Thankyou way was pretty easy and time saving

rahiisin
Автор

YOUR A FUCKING LEGEND MATE! SUB EARNED

maxkillers
Автор

Thank you. I'd forgotten the exact commands for this!

Avrysatos
Автор

Thanks! this saved my youtube video!! :)

ItsEyal
Автор

How can you change a filename to another name that has more characters in it? This method doesn't work properly for that unfortunately

pingopete
Автор

Thanks ;> You just saved me like ten minutes of renaming ;p

xXDEADLygAMerZXx
Автор

Kudos to you ! :) You saved me a lot of trouble ! Thank you :)

drobkins
Автор

thx. i watch all the Tricks in ur Videos.. Very Helpful.

harshmajra
Автор

ThankYou works great to change Cannon camcorder  FS100 MOD Files to MPG (file extension) , quickly in windows  (spend more money  10 ) ;) For those interested ( I also installed windvd11 to get codec)

artonal
Автор

Hi,
the video shows to rename in numbers like abc(1)
abc(2) is there a way to rename with out () like abc1 abc2
??

yossi
Автор

I have a question, I would like to rename files with NO Extension to a new name, this is what I have new_300256_7.Aug 2020, and new_300265_8.Aug 2020, I want to erase that and rename to new300K08, and new300k09, the next code would also read new300K10, I saw your video, and I think renaming everything before the .txt would be perfect, but my files don't carry extensions

javierrivas
Автор

how do you do this when all the file extensions are different for the source files? this method is giving me "file not found or duplicate file found" and not changing anything. thanks. i'm trying ren *.* *.txt, but it won't do it.

jamesbradford