Run below query and copy the results new query window run results
DECLARE @SQL VARCHAR(MAX) = ''
SELECT
@SQL = @SQL + 'use master' + CHAR(13) + CHAR(10)
+ 'ALTER DATABASE ['+ d.name +'] SET SINGLE_USER WITH ROLLBACK IMMEDIATE;' + CHAR(13) + CHAR(10)
+ 'DROP DATABASE [' + d.name +'];'
FROM
sys.databases d
where d.name like 'TempDB_%'
print @SQL
exec(@SQL)
DECLARE @SQL VARCHAR(MAX) = ''
SELECT
@SQL = @SQL + 'use master' + CHAR(13) + CHAR(10)
+ 'ALTER DATABASE ['+ d.name +'] SET SINGLE_USER WITH ROLLBACK IMMEDIATE;' + CHAR(13) + CHAR(10)
+ 'DROP DATABASE [' + d.name +'];'
FROM
sys.databases d
where d.name like 'TempDB_%'
print @SQL
exec(@SQL)