Question Locked

Files rename

0 helpful
2 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

Hi,
am trying to rename series of files as following
Hello.txt -to- hello123.txt
test.txt -to- test123.txt

any idea how to do add text after the file name and bfore the extentions. I tried this cod but it does not work well
for /f %%i in ('dir /b /a-d *.txt') do @ren %%i %%i.txt.

Thanks

2 replies

by Member 25348569

First of all, don't use /F as it isn't required and you're making it too complicated.

for %%i in (d:\path\*.txt) do ren %%~fi %%~ni123.txt

Neil :)

This discussion is closed to new replies.