Rename filename by removing first part to end

October 6, 2009 at 01:42:33
Specs: Windows XP
I want to change the filename by moving the first part of the filename to the end of the filename in a batch.

example:
20090101 - xxxxx - aaaaa.pdf
to
xxxxxxx - aaaaaa - 20090101.pdf

does anyone know a solution for this?


See More: Rename filename by removing first part to end

Report •


#1
October 6, 2009 at 04:02:10
Post this in the Programming Forum... linkon the right of this page.

Home Page http://ewen.uuuq.com/


Report •

#2
October 6, 2009 at 04:51:38
This is hardwired to work on PDF files.

==================================
@echo off & setLocal EnableDELAYedExpansion

for /f "tokens=* delims= " %%a in ('dir/b/a-d *.pdf') do (
for /f "tokens=1-3 delims=- " %%i in ("%%~Na") do (
ren "%%a" "%%j - %%k - %%i%%~Xa"
)
)


=====================================
Helping others achieve escape felicity

M2


Report •

Related Solutions


Ask Question