We had a couple of times the demand to transfer SQL related files from C:\ drive to D:\ drive because system backups need them to be elsewhere and the person who installed SQL Server (and the databases) was not DBA.
Here is the way I recommand to run the script if you are not used to use it :
- Copy-Paste the code of the script in a connection to the SQL Server instance of your choice
- Modify the #CHANGEME to 1 so that the script does not change anything on the server
- Execute the script
- Copy the result in another window and run the commands
We ran it a couple of times and it seems to be working as expected.
Hope this helps.