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

Guido's How-Tos
Guido's How-Tos
106 هزار بار بازدید - 10 سال پیش - Batch files 4: How to
Batch files 4: How to change / rename the filename or file extension of multiple files at once Batch files part 5:    • Close multiple programs at once using...   #batchfile #batch Follow me on other media: ►Website: www.guidoshowtos.com/ ►Facebook: www.facebook.com/guidoshowtos ►Twitter: twitter.com/guidoshowtos Music used: Think Tank (audionautix.com) 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: "@echo off 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".
10 سال پیش در تاریخ 1393/05/23 منتشر شده است.
106,093 بـار بازدید شده
... بیشتر