Sql-server – Restore script in SQL server doesn’t work in W7

backuprestoresql server

I need a little help with a restore process, I can't find specific help in other similar questions, sorry if my question does not correspond.

I have this script in my system:

RESTORE DATABASE [Basesistema] FROM DISK = N’C:\Sistema\backup.bak’ WITH FILE = 1, NOUNLOAD, REPLACE, STATS = 10

It work perfect in Windows XP, but not in Windows 7…

The message is:

Error al buscar el archivo ‘C:\Archivos de programa\Microsoft SQL Server\MSSQL10.SQLEXPRESS\MSSQL\DATA\Basesistema.mdf’ en los directorios, error del sistema operativo: 3(failed to retrieve text for this error. Reason: 15105)

English translation:

Failed to find file 'C: \ Program Files \ Microsoft SQL Server \
MSSQL10.SQLEXPRESS \ MSSQL \ DATA \ Basesistema.mdf' directories,
operating system error: 3 (failed to retrieve text For This error.
Reason: 15105)

What can I do?
Thanks for your help!!

Followup:

Well, actually I need restore from a script embedded in my system, not from SSMS; but SSMS (even as Admin) did not have access to the backup file.
If I move the file to C: or D: is the same…

I have SQL running under Windows Autentication account (integrated security), my only windows account have admin rights… I don't understand what happens.

The curious is the path "MSSQL10.SQLEXPRESS" doesn't exists, SQL is in "..\MSSQL10_50.SQLEXPRESS\MSSQL..". Does this have something to do?

Best Answer

You don't need rights to access the backup file, the SQL Service does. Running SSMS as administrator will not help.

Check that the account you have SQL running under is able to read from that directory.