Yeah... I forgot this...
Anyway, put a condition on your script, checking if the tdm file have a respective txt file.
Or just list all target file names instead of using mask filter, this way you guarantee that script will works only on the files you want.
Sometimes, there's a lot of files to list, making hard to do by hand, so I maked a tool to help on this job:
BAT_Generator_By_Delutto.7z
Ps.: Sorry, last compilation has failed. Attachment updated.