The script will create a SQL command from a select of sys.master_files and then will create a cursor for that to execute each SQL command alone after.
The script is written in Transact SQL, and this is the Format of the script :

This is the code :
DECLARE @sqlcommand…