Use the system view “sys.master_files” for a single view of databases and database files.
Instead of using sys.sysfiles joing to sys.sysdatabases use the sys.master_files
select DB_NAME(database_id),mf.name as [file_name],physical_name FROM sys.master_files as mf