You misunderstand what the string between =1 and " of the delims option does.
It is not a delimiter-string.
It is a set of characters , each one of which is a delimiter.
SET "delimiterstring=[im"
for %%A in ("*.mkv") do (
echo file found %%A
for /f "tokens=1,2,3 delims=[im" %%D in ("%%~nA") do ECHO 1="%%D" 2="%%E" 3="%%F"
set "shortname=%%~nA"
SET "endpart=!shortname:*%delimiterstring%=!"
ECHO lopped shortname="!endpart!"
call SET "shortname=%%shortname:%delimiterstring%!endpart!=%%"
echo short name "!shortname!"
)
Note that the for /f…%%D sets tokens 1,2 & 3 for the filename Thunderbolts [imdbid-tt20969586].mkv. The string is interpreted as [stringofdelimiters][stringofdata], repeated. Since '[','i','m' are defined as the delimiter characters, the tokens are generated as 1="Thunderbolts " 2="db" 3="d-tt20969586]"
Note also the Space at the end of the first token. The delims option does not permit a space as a delimiter, other than as the final character of the delims= string.
Your approach would thus also fail if "Thunderbolts " contained '[','i','m'
The remainder indicates one way to process the string. It sets endpart by replacing all characters up to and including delimiterstring with nothing then setsshortname to its initial value with [delimiterstring+endpart] replaced by nothing using the call parsing trick (used thousands of times on SO) to arrange the desired operation.
You should be careful about any "poison" characters (character with a special meaning to cmd such as !%~&^()
Note that you could also change delimiterstring to include the space in the desired position to remove the end-space from "Thunderbolts "
for/fand/rswitches are incompatible. You need the outer loop to be recursive, not the inner one (which doesn't list files, but just dissects a string):for /R %%A in ("*.mkv") do ..... I'm a bit sceptical about your delimiters though,iormmight exist in unexpected places.>J:\list.txtwould create a new file every single time the loop was executed so that only the very last result would appear in the file AND the space following!shortname!would be included in the result file. Either use'>>J:\list.txt" (which would append to any existingJ:\list.txt) or enclose the entirefor %%A` loop in a parenthesis pair and redirect; ie(for %%A…) )>J:\list.txt