So it looks like SQL has the files locked. You'll need to restore to a different file location (SQL will delete the files in use automatically). If you like you can then script a move of the datafiles back to where you need them.
e.g.
<MSBuild.ExtensionPack.Sql2008.Database TaskAction="Restore" DatabaseItem="Assassin" DataFilePath="....\DBBackups\Assassin.bak" ReplaceDatabase="True" NewDataFilePath="C:\Program Files\Microsoft SQL Server\MSSQL10.MSSQLSERVER\MSSQL\DATA\Assasin_Restore.mdf"LogFilePath="C:\Program Files\Microsoft SQL Server\MSSQL10.MSSQLSERVER\MSSQL\DATA\Assassin_Restore_log.LDF"LogName="Assassin_log"/>
I think I edited that right... heres my working repo:
e.g.
<MSBuild.ExtensionPack.Sql2008.Database TaskAction="Restore" DatabaseItem="Assassin" DataFilePath="....\DBBackups\Assassin.bak" ReplaceDatabase="True" NewDataFilePath="C:\Program Files\Microsoft SQL Server\MSSQL10.MSSQLSERVER\MSSQL\DATA\Assasin_Restore.mdf"LogFilePath="C:\Program Files\Microsoft SQL Server\MSSQL10.MSSQLSERVER\MSSQL\DATA\Assassin_Restore_log.LDF"LogName="Assassin_log"/>
I think I edited that right... heres my working repo:
<MSBuild.ExtensionPack.Sql2008.Database TaskAction="Restore" DatabaseItem="Mike" DataFilePath="C:\Databases\Backup\Mike-b.bak" NewDataFilePath="c:\b\Mike.mdf" ReplaceDatabase="true" LogFilePath="c:\b\Mike_log.ndf" LogName="Mike_log"/>
Mike