I am trying to write a simple for command which renames files found in a folder with a prefix like:
c0001.mp4 becomes card1-c0001.mp4
It works, however, the first file gets renamed twice: card1-card1-c0001.mp4 when I run this code. It doesn't matter what folder or file name, the first file in sequence is always double renamed.
All other files are fine. if I change the command to an echo, it looks right. What am I missing?
for %%a IN ("F:\2016-Sep-18\card1\*.mp4") do ren %%a card1-%%~nxa