When restoring a database, in my case a backup from a SQL Server 2005 database including a fulltext catalog, to a SQL 2008 server on a development machine running Windows 7, I received the followin error:

Restore failed for Server 'Servername'

Additional information:

System.Data.SqlClient.SqlError: The operating system returned the error '32 (The process cannot access the file because it is being used by another process.)' while attempting 'RestoreContainer::ValidateTargetForCreation' on 'DatabasePath'. (Microsoft.SqlServer.Smo)

Nothing helped, neither restaring the SQL server nor trying to kill any open processes. Every time I tried using the Management Studio to restore the database I received the same error.

However, I found a way to get around it, by restoring the database with the following script:

RESTORE  DATABASE mydatabase
FROM DISK = 'C:\SQL2008\Backup\database_backup.bak'
WITH RECOVERY,
  MOVE 'mydatabase' TO 'C:\SQL2008\mydatabase.mdf',
  MOVE 'mydatabase_log' TO 'C:\SQL2008\mydatabase_log.ldf'