I need some help creating a batch file to rename some 6k files.
The file names are seven numbers dot jpg.
NNNNNNN.jpg (b4)
I would like to change the first number only and swap it with 3 letters and a dash.
LLL-NNNNNN.jpg (after)
I would like to do that to all contents of a given directory until every file is modified in that format.
Thanks in advance for the assist.
Nelson
Batch routine to change file names
Moderator: DosItHelp
Hi Nelson,
begin with this
jeb
begin with this
Code: Select all
@echo off
setlocal enableextensions
setlocal enabledelayedexpansion
set srcPath=c:\temp\hund
set prefix=LLL-
echo %prefix%
for %%a in (%srcPath%\*.*) do (
set oldName=%%~nxa
set newName=%%~dpa%prefix%!oldName:~1!
echo ren !oldName! !newName!
)
jeb