Nope I forgot the brackets. Try this:
DECLARE database_cursor CURSOR FOR SELECT name FROM master..sysdatabases
DECLARE @database_name sysname
OPEN database_cursor
FETCH NEXT FROM database_cursor INTO @database_name
WHILE @@FETCH_STATUS=0
BEGIN
PRINT @database_name
DBCC SHRINKDATABASE (@database_name)
FETCH NEXT FROM database_cursor INTO @database_name
END
CLOSE database_cursor
DEALLOCATE database_cursor