How can I add an extension to multiple file names?

I have a folder containing multiple files with names like:

pnahc.d_m05d17h09m30

I want to place an extension at the end of the filename so that the new filename looks like:

pnahc.d_m05d17h09m30.txt

I tried using ren *. *.txt, but it did not work. How can I do this?


According to this page you could try running these commands in powershell (search for it in the windows start menu):

cd "\path\to\dir"
Dir | rename-item -newname  { $_.Name +".jpg" }

Bulkrename can do it, first "remove" the extension, hit rename then hit reset, then add the one you want using the "extra" function. You can do this for multiple files in the same folder.

. enter image description here

.

enter image description here


A single command line command will do the trick:

for /f "tokens=*" %a in ('dir /b') do @ren "%a" "%a.txt"

Just change into the folder with the files.