The issue is with how the /D option is used—it needs to be applied to the forfiles command directly, not inside the cmd /c part.
Try modifying your code like this:
echo off
forfiles /p "c:\users\J33333\Desktop\DDrive\test" /s /m "TS*.xmt" /D -30 /c "cmd /c del @file"
exit
Here's the breakdown:
This should delete only the files that match both criteria: filenames starting with "TS" and older than 30 days.