title: Error 5123 in SQL Server 2008 R2
body: <p>I changed my windows. But I can not attach <code>mdf,ldf</code> files and cannot move or copy them.</p>
  
  <p>My error is:</p>
  
  <blockquote>
    <p>Failed to retrieve data for this request. (Microsoft.SqlServer.Management.Sdk.Sfc)<br>
    An exception occurred while executing a Transact-SQL statement or batch.<br>
    CREATE FILE encountered operating system error 5 (Access is denied) while attempting to open or create the physical file 'D:\Project\Masoomi\UniversityService\DataBase\Universityservice.mdf'. (Microsoft SQL Server, <strong>Error: 5123</strong>)</p>
  </blockquote>
  
  <p>I run as administrator too. My windows is 7 and I installed SQL Server 2008 R2.</p>
  
  <p>My previous windows was 7 and SQL Server 2008 R2. </p>
  
  <p>What shall I do?</p>