gmmastros,
Thank you for that, it was just what I was looking for!
I connected to the 'master' DB and used:
Call oConn.Execute("EXEC sp_detach_db 'W:\Temp\SQL 2014\MyDB1.mdf', 'true';")
Call oConn.Execute("EXEC sp_detach_db 'MyDB2', 'true';")
Worked perfectly!
yelworcm, that is not what I meant. Sorry for the misunderstanding and making it clearer.