Well, DOC's untested code might do with some smithing. Don't think you need to wrap the enviro var in quotes and no need to double up on the %%. No need for 1024 of env space either.

Might stand to have a few well placed quotes thought.

(untested)
SHELL '"%COMSPEC%" /c DEL /S /F /Q "' + %USERPROFILE% + '\*.TMP"'
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.