Re: rename extention of a file
Posted: 15 Jan 2021 17:05
You might do something like that (sketched and untested):
Sidenote: I echoed the commands it should do, so you can check if that's what you like to perform.
In case you are satisfied with the commands created, you might want to delete the "echo(".
penpen
Code: Select all
@echo off
setlocal enableExtensions disableDelayedExpansion
set "N=1000000000"
for %%a in ("*12345-*" "*-*12345") do (
for /f "tokens=* delims=" %b in ('set /a "N"') do (
echo(ren "%%~a" "%%~b.txt"
)
set /a "N+=1"
)
goto :eof
In case you are satisfied with the commands created, you might want to delete the "echo(".
penpen