Or, as something a tad easier:
exec sp_MSforeachDB 'USE [?]; IF ''?'' NOT in (''master'',''model'',''msdb'',''tempDB'') DBCC ShrinkFile(2,10)'
Untested, so may have syntax errors. Test before use.
Shrinkfile takes either the file name or the file ID as the first parameter, and the first log file is always file ID 2 (and if you have more than one log file, that needs fixing)
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability