2
votes

so to make myself a little more clear

file1.ext1.ext2 >>  file1.ext2
file2.ext3.ext4 >>  file2.ext4
...
           ->rename to->

I'm trying to achieve this with a for loop but I am stuck

for %%i in (c:/) do ren %%i.??? to %%~ni.???

any could give me a hint

1

1 Answers

1
votes

This should work

@echo off
for %%a in (file*) do (
    for %%f in ("%%~na") do (
        ECHO ren %%~a %%~nf%%~xa
    )
)