Re: renaming files
From: Matthias Tacke (Matthias_at_Tacke.de)
Date: 06/06/04
- Next message: djc: "get around having to specify its a directory or file"
- Previous message: Bill Stewart: "Re: ntlib.cmd (Advanced NT/2K/XP/K3 Command Library)"
- In reply to: rmachado: "renaming files"
- Messages sorted by: [ date ] [ thread ]
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
- Next message: djc: "get around having to specify its a directory or file"
- Previous message: Bill Stewart: "Re: ntlib.cmd (Advanced NT/2K/XP/K3 Command Library)"
- In reply to: rmachado: "renaming files"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|