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

Показать описание
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".
#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".
Комментарии