Re: renaming files

Tech-Archive recommends: Fix windows errors by optimizing your registry

From: Matthias Tacke (Matthias_at_Tacke.de)
Date: 06/06/04


Date: Sun, 6 Jun 2004 23:18:58 +0200


<rmachado> schrieb :
| hi
| is there a way i could rename same files in diferent folders
|
| ex :
|
| folder and file tree
|
| c:\temp\ferrari.log
| c:\temp\temp1\porche.log
| c:\temp\temp2\honda.log
|
| c:
| cd temp
| c:\temp>ren *.log *.txt
|
|
| thks
|

>From the command line :

for /f "delims=" %A in ('dir /B /S c:\temp\*.log') do ren "%A"
"%~nA.txt"

In a batch double the percent signs.

The dir creates a list of all *.log file, the for passes each file to
the ren command. %~A strips path and extensions from the file leaving
the name to which the new extension .txt is appended.

For details see the help :
for /?

HTH

--
Greetings
Matthias


Relevant Pages

  • renaming files
    ... is there a way i could rename same files in diferent folders ... folder and file tree ...
    (microsoft.public.win2000.cmdprompt.admin)
  • Re: renaming files
    ... rmachado wrote: ... > is there a way i could rename same files in diferent folders ... > folder and file tree ...
    (microsoft.public.win2000.cmdprompt.admin)