1.

Solve : Batch Rename file extensions?

Answer»

I have multiple folders where I am trying to rename the file extensions in each.

ren *.TIF *.gif This will only work in the current folder but I need all files to be changed from tif to gif in all folders......

Any help is greatly appreciated...I have a question - renaming from .tif to .gif doesn't change the binary format of the files so how come you're renaming from .tif to .gif ?

If you're not ACTUALLY renaming .tif files, then why don't you say what you are really doing?Thanks for the response...

That was actually an example... I am renaming an extension of .fil to either .tif or .gif

I need to be able to accomplish this in all subfolders without going to each folder manually.Use the search function...*.til switch will list all files with that extension....
Then tag all the files and rename the extension.Or visit the APPS Author 's site for a solution...Or you can try This...I need this to work for all subfolders and not just the current folder.type or paste this at the command prompt in the top folder

for /f "delims=" %A in ('dir /b /s *.ext1') do ren "%~dpnxA" "%~nA.ext2"

change .ext1 to the extension you want to change from, and ext2 to the new extension

Thanks!! WORKED like a charm....This will save me a WHOLE lot of time!!You can put this batch script in the top folder and it will ask you for the old and new extensions

If you do not want to see the filenames as they are renamed delete the line shown

@echo off
Echo Rename extensions in folder and subfolders
set /p ext1="EXISTING extension [including dot]? "
set /p ext2="New extension [including dot]? "
for /f "delims=" %%A in ('dir /b /s *%ext1%') do (
ren "%%~dpnxA" "%%~nA%ext2%"
REM delete next line to hide filenames
Echo rename "%%~dpnxA" to "%%~nA%ext2%"
)
echo.
echo Done
Pause





Discussion

No Comment Found