EXECUTE sp_msforeachdb
'USE ?;
Alter Database ? Set Recovery Simple;
Alter Database ? Set Recovery Full;
DECLARE @LogLogicalName nvarchar(100);
SELECT @LogLogicalName = file_name(2);
dbcc shrinkfile(@LogLogicalName, 1);
dbcc shrinkfile(@LogLogicalName, 1);
dbcc shrinkfile(@LogLogicalName, 1);
dbcc shrinkfile(@LogLogicalName, 1);'