How to append extension to files of diff type

November 3, 2010 at 13:16:50
Specs: Windows XP
I have files with different naming convetions in a directory x
Files can be
foo.bar.F
foo.bar.R
foo.bar.R1

I need to append .ab1 at the end of all the files in the directory:

foo.bar.F.ab1
foo.bar.R.ab1
foo.bar.R1.ab1


I tried rename with different options and couldn't get it to work. Help is greatly appreciated!


See More: How to append extension to files of diff type

Report •


#1
November 3, 2010 at 13:40:08
CORRECTION

@echo off & setLocal EnableDELAYedeXpansion

for /f "tokens=* delims= " %%a in ('dir/b/a-d') do (
ren %%a %%a.ab1
)


=====================================
Life is too important to be taken seriously.

M2


Report •

#2
November 4, 2010 at 06:12:28
Hi Mechanix,
Thanks for your reply. I get the following error

%%a was unexpected at this time. I typed the command exactly as you suggested. Should I create a batch file?

Thanks


Report •

#3
November 4, 2010 at 07:15:23
Should I create a batch file?
Yes.

How To Ask Questions The Smart Way


Report •

Related Solutions


Ask Question