How to batch modify file suffix

foreword


Due to the needs of the work, it is necessary to batch process the suffix names of the pictures. If you modify them one by one, what year and month will you change them? Later, Baidu has made some changes. In fact, there are many methods to modify the file suffix names in batches. Here I will share the most popular one. Simple and crude method.


operate


1. Put all the files that need to modify the suffix name into a folder, and the computer can unhide the suffix name (go to Baidu if you don't understand).


2. Create a new notepad file in the folder, and add the content: ren space asterisk point the file suffix name to be modified space point the suffix name you want to change, save. Such as converting gif to jpg: ren *.gif *jpg



3. Change the suffix of the txt file saved above to .bat such as


4. Double-click to run the .bat file modified in step 3 to complete the modification.



demo




After running the .bat file





---------------------------------------------renew---- ---------------------------------------


The method described above can only process files in one folder. If a main directory contains multiple sub-folders, it is not suitable. Here is a general method:


  • Change the statement in the above .bat to the following, and put the bat file in the main directory folder for execution.

       @for /r %%i in (*. The suffix name that needs to be changed) do @ren "%%i" "%%~ni. The suffix name that needs to be changed"

        如jpg修改成png:@for /r %%i in (*.jpg) do @ren "%%i" "%%~ni.png"



Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325555362&siteId=291194637