we can replace below SQL with the help of
sp_Helpfile and
MS_foreachDB sys.master_files contains a row per file of a database as stored in the master database
The minimum permissions that are required to see the corresponding row are CREATE DATABASE, ALTER ANY DATABASE, or VIEW ANY DEFINITION
select distinct @@Servername AS Server ,
name AS DatabaseName ,
File_id ,
physical_name,
state_desc DBStatus,
size SpaceUSed,
growth GrowthPercentage
from sys.master_files