 <p>Assuming none of your file names contain any additional dots other than <code>.ogg.M4A</code>, then all you need is a single <code>REN</code> command.</p> <pre><code>ren *.ogg.M4A ??????????????????????????????.m4a </code></pre> <p>Be sure to use enough <code>?</code> to match the longest name in your file set.</p> <p>See <a href="http://superuser.com/q/475874/109090">How does the Windows RENAME (REN) command interpret wildcards?</a> for a full explanation of how REN handles wildcards.</p>