the script would do it if it was integrated properly with the T-SQL commands to modify the file locations and offline\online the database. It just requires a little development and error handling (what if the file fails to copy and you then try to online the db 😉 )
SSIS??
-----------------------------------------------------------------------------------------------------------
"Ya can't make an omelette without breaking just a few eggs" 😉