Something like this should work, but there are UDF scripts for this that allow more control of what or when items are deleted.

Code:
If Len('%temp%\')>5
DEL '%TEMP%\*.*' /c /f /h /s
EndIf