Friday 27 December 2013

How to rename files using batch file


How to rename files using batch file

Open Note pad and paste the below code

@echo off
Setlocal enabledelayedexpansion

Set "Pattern=6288"
Set "Replace=reuse"

For %%a in (*.jpg *.gif *.png) Do (
    Set "File=%%~a"
    Ren "%%a" "!File:%Pattern%=%Replace%!"
)

endlocal

Save note pad as .BAT extension and then run and enjoy.....


No comments: