2

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

Rps
  • 277
  • 1
  • 5
  • 25

1 Answers1

1

This should work

@echo off
for %%a in (file*) do (
    for %%f in ("%%~na") do (
        ECHO ren %%~a %%~nf%%~xa
    )
)
jeb
  • 78,592
  • 17
  • 171
  • 225