Great script! Works perfectly on Default Instances. I just can't get it to work on any of my Named Instances. Like Server\Database. I get connection error messages when connecting to the Instance and path errors when it tries to write the files. Have you been able to look into this issue? Thanks for the hard work you put into this, very useful!!
Frederick (Fred) J. Stemp, Jr.
Database Administrator / Database Developer
Dealer Funding, LLC
'...if they take my stapler then I'll set the building on fire...'