/easy-renamer

BAT File to Remove Common Part from Files in a Folder

Primary LanguageBatchfileGNU General Public License v3.0GPL-3.0

Easy Renamer

Easy Renamer is a batch file to remove a common part from files in a folder. This script can be used in Compress PNG, JPG services to remove -min part from file names.

How to Use

  • Download the renamer.bat file.
  • Open it with text editor (Notepad).
  • Enter the common text in line 3 and 5. Replace the COMMON_TEXT with your phrase.
  • Save the file and copy to the directory which has the files to rename.
  • Double click and run it.

Example Code

Remove -min of all png files in the folder.

alt text

Code will be looks like this.

@echo off
setlocal enableDelayedExpansion
for %%F in (*-min*) do (
  set "name=%%F"
  ren "!name!" "!name:-min=!"
)

Places to Use

This is very useful if you use multiple file processing in Compress PNG, Compress JPG services.