Rename many files in subfolders

  • Thread starter Thread starter Lars
  • Start date Start date
L

Lars

Hi group,

I know how to rename files from a cmd-prompt using
wildcards, but I can not find an appropriate switch do do
the job in subfolders.

Do you know?

Years ago when I frequently used Textpad for larger ASCII
files I thought it a good idea to save them with the
extension "txp". Since a couple of years now I have replaced
Windows Notepad with "Metapad" and I rarely feel any need
for Textpad.

I have hundreds of these *.txp's in well over a hundred
subfolders to My Documents. I would want them to remain in
their folders and retain their names except the very last
letter in the extension.

<Ren *.txp *.txt> works fine but only in that particular
folder.

I have a feeling I have done this on one computer but can
not remember how.


Lars
Stockholm
 
Hi group,

I know how to rename files from a cmd-prompt using
wildcards, but I can not find an appropriate switch do do
the job in subfolders.

Do you know?

Years ago when I frequently used Textpad for larger ASCII
files I thought it a good idea to save them with the
extension "txp". Since a couple of years now I have replaced
Windows Notepad with "Metapad" and I rarely feel any need
for Textpad.

I have hundreds of these *.txp's in well over a hundred
subfolders to My Documents. I would want them to remain in
their folders and retain their names except the very last
letter in the extension.

<Ren *.txp *.txt> works fine but only in that particular
folder.

I have a feeling I have done this on one computer but can
not remember how.


Lars
Stockholm

From the CMD prompt:


for /r %a in (*.txp) do @echo ren "%a" "%~na.txt"


If this appears to do what you intend, remove '@echo'.
 
Hi,

What does the "%~na.txt" do?

Mike
--

Phil Robyn said:
From the CMD prompt:


for /r %a in (*.txp) do @echo ren "%a" "%~na.txt"


If this appears to do what you intend, remove '@echo'.

--
Phil Robyn
Univ. of California, Berkeley

u n z i p m y a d d r e s s t o s e n d e - m a i l
 
Back
Top