Skip to main content

Posts

Showing posts with the label Batch file

Batch File - Bulk Renamer ... Advanced

This post is the continuation of my last post, i.e., Batch File - Bulk Renamer ; related to systematically renaming all the files in a folder. The problem I noticed with my previous code is that, either it works with the particular type of file (aka same extension) or in absence of file-extensions it renames this batch file also. So I thought to introduce a condition in this so as to skip this batch file while renaming other files. Here is the code for that, .:C.O.D.E:. @echo off&set /a cnt=1 for %%a in (*) do call :PROCESS "%%a" goto :EOF :PROCESS IF not %1=="bulk_renamer.bat" (rename %1 "IMG_%cnt%.jpg") set /a cnt+=1 Note : This code would rename all the files present in the folder except bulk_renamer.bat Help : Refer to my previous post for the steps to create or modify the script. Link : http://akzcool.blogspot.com/2010/11/batch-file-bulk-renamer.html

Batch File - Bulk Renamer

Below is the batch-file code to systematically rename all the files present in the folder according to the given condition. .: C.O.D.E :. @echo off&set /a cnt=0 for %%a in (*.jpeg) do call :PROCESS "%%a" goto :EOF :PROCESS rename %1 "IMG_%cnt%.jpg" set /a cnt+=1 .: S.T.E.P.S :. Step-1 : Open a Notepad. Step-2 : Copy the above code and paste it in Notepad. Step-3 : Save the file as "bulk_renamer.bat" . Step-4 : Put the  bulk_renamer.bat file inside the folder that is having the files which needs to be renamed. Step-5 : Run the  bulk_renamer.bat file by double clicking on it. Note: This batch-file should be present inside the folder where rest of the files that needs to be renamed are present. Remark: Modify the script and condition as per your requirement.