How to remove a prefix from multiple files?
问题 I downloaded a lot of videos that are named like [site.com] filename.mp4 and I wanted to remove the prefix so that they are named like filename.mp4 . I tried a batch file with the following code: ren "[site.com] *.mp4" "///////////*.mp4" But the result was .com] filename.mp4 and can't rename anything beyond the dot, any ideas? 回答1: @ECHO OFF SETLOCAL SET "sourcedir=U:\sourcedir" FOR /f "tokens=1*delims=]" %%a IN ( 'dir /b /a-d "%sourcedir%\*" ' ) DO IF "%%b" neq "" ( FOR /f "tokens=*" %%h IN