Re: Changing file names 'in bulk'

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance




"Keith H" <kt.holmes@xxxxxxxxxxxx> wrote in message
news:U2Mmj.48262$ov2.11414@xxxxxxxxxxxxxxxxxxxxxxx
I have several hundred files with titles beginning with a reference number.
I want to move each reference number to the end of the title.
Eg: I want "MP031 Amazing Grace.ppt"
to become "Amazing Grace MP031.ppt"
and so on for each of the others, too

Any ideas for a 'batch process'?

This sort of thing is usually handled by "Superb Batch Renamer"
(http://www.1-4a.com/rename/). However, in your case I was
unable to fine a way to get it to do what you want - perhaps
you can find a way yourself. If not then try this batch file:

@echo off
set Source=d:\My Data
pushd "%Source%"
dir /a-d /b > "%temp%\dir.txt"
for /F "tokens=1*" %%a in ('type "%temp%\dir.txt"') do echo ren "%%a %%b"
"%%~nb %%a%%~xb"
popd

Note that the last line is a long line. It starts with "for" and ends with
"~xb"". To activate the batch file you must remove the word "echo"
from the last line.


.



Relevant Pages

  • Re: One more Pu-Erh mistery
    ... factories will introduce some puerh from a previous batch to inoculate ... have never found a solid reputable reference that confirms this. ... I can usually recognize a taste in raw Xia Guan but have never really ... that is conducive to certain microbial strains, ie each type of microbe ...
    (rec.food.drink.tea)
  • Re: DOS Batch File help
    ... Many commands have detailed additional help. ... > Years ago I did a lot of writing of DOS batch files. ... > some kind of quick reference for "old school" folks like me to use as a ...
    (microsoft.public.windows.file_system)
  • Reheating Meat Pies
    ... With reference ... to Sweeny Todd, we are serving meat pies. ... We prepared a large batch ...
    (rec.food.cooking)
  • Re: One more Pu-Erh mistery
    ... factories will introduce some puerh from a previous batch to inoculate ... have never found a solid reputable reference that confirms this. ... Secret" etc as if they would be prosecuted if they told. ... say there's a Menghai taste. ...
    (rec.food.drink.tea)
  • Re: Any change I make to web.config gives server application unavailable error!
    ... I do have 2 aspx pages that reference the same code behind page - ... during the local compile, if they are ... compiled in the same batch ok, ... web server becomes unavailable. ...
    (microsoft.public.dotnet.framework.aspnet)