I want to rename files in a directory using this command :
for /r %%x in (*.ath) do ren "%%x" *.txt
The problem is if the filename already exists, the file is not replaced. Is there a simple way to delete the old file and then rename the new one ? Thanks
To elaborate on @Ben's comment use
for /r %%x in (*.ath) do move "%%x" "%%~nx.txt" /y