title: SQL Server Restore Error - Access is Denied to root folder, but works fine if I point the file to a sub folder
body: <p>I am trying to restore a database from a backup (<code>.bak</code>) file which has four different files. I am trying point each file into a different disk drive on the server. The server has following four drives:</p>
  
  <ol>
  <li>Data (<code>G:\</code>) </li>
  <li>Index (<code>H:\</code>)</li>
  <li>Changes (<code>I:\</code>) </li>
  <li>Log (<code>J:\</code>)</li>
  </ol>
  
  <p>I'm getting the following error when I try to save the file into the root folder (for example: I have pointed the index file to <code>H:\DbRestore_Test-index.mdf</code>), but if I point to a subfolder in the same disk drive it is working without an issue (for example: <code>H:\Indexes\DbRestore_Test-index.mdf</code>).</p>
  
  <blockquote>
    <h2>TITLE: Microsoft SQL Server Management Studio</h2>
    
    <p>Restore of database 'DbRestore_Test' failed.
    (Microsoft.SqlServer.Management.RelationalEngineTasks)</p>
    
    <p>------------------------------ ADDITIONAL INFORMATION:</p>
    
    <p>System.Data.SqlClient.SqlError: The operating system returned the
    error '5(Access is denied.)' while attempting
    'RestoreContainer::ValidateTargetForCreation' on
    'H:\DbRestore_Test-index.mdf'. (Microsoft.SqlServer.SmoExtended)</p>
    
    <p>For help, click:
    <a href="http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&amp;ProdVer=11.0.2100.60+((SQL11_RTM).120210-1917+)&amp;LinkId=20476" rel="nofollow noreferrer">http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&amp;ProdVer=11.0.2100.60+((SQL11_RTM).120210-1917+)&amp;LinkId=20476</a></p>
  </blockquote>
  
  <p>I have taken a look at this <a href="https://stackoverflow.com/questions/7031792/sql-server-restore-error-access-is-denied">Stackoverflow page</a>: Ticking the <code>Relocate all files to folder</code> checkbox doesn't help as I need to save files into four different drives and there is an option to specify only two drives.</p>
  
  <p>As I mentioned above, I can resolve this by simply pointing/saving the file into a subfolder within that drive, but curious to know the reason why I wasn't able to restore it into the root folder itself. Any help/advise would be much appreciated.</p>
  
  <p><strong>Environment:</strong></p>
  
  <blockquote>
    <p>SQL Server 2012 </p>
    
    <p>Windows Server 2012 R2 Standard</p>
  </blockquote>