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?
You would need to change the setting of
sourcedirto suit your circumstances.The required REN commands are merely
ECHOed for testing purposes. After you've verified that the commands are correct, changeECHO(RENtoRENto actually rename the files.Perform a directory scan of the source directory, in
/bbasic mode/a-dwithout directories and tokenise each filename found - the part before the first]to%%aand the remainder to%%b.If
%%bis not empty (ie. did not contain]) then do nothing, therwise use the default token set (which includes space) andtokens=0to strip the leading spaces from%%binto%%h, then build the original filename and rename.