title: Permission error with ASP Classic on IIS using copyFile
body: <p>I'm writing a repository in ASP classic (using JScript) running on IIS 7.0 and I'm having some trouble with permission when moving files around. I have to following generic function that always gives me a permission denied error.</p>
  
  <pre><code>function moveFile(source, target){
      fs = new ActiveXObject("Scripting.FileSystemObject");
      newloc = target + "\\" + source.name;
      debug("Copying file: " + source.path + " to " + newloc);
      fs.copyFile(source.path, Server.MapPath( "repository/" ), true);
  
  }
  </code></pre>
  
  <p>When I call the function with with source <code>source.path</code> being <code>D:\Inetpub_EXT\wwwroot\builder\repo\dump\alicia.docx</code> and target being <code>D:\Inetpub_EXT\wwwroot\builder\repo\repository</code> I get the following output:</p>
  
  <pre><code>Treating dumpfile: alicia
  Copying file: D:\Inetpub_EXT\builder\repo\dump\alicia.docx to 
  D:\Inetpub_EXT\wwwroot\builder\repo\repository
  Microsoft JScript runtime error '800a0046'
  Permission denied 
  </code></pre>
  
  <p>I've verified that both the folder and file exist and I gave full control to IIS_WPG, IUSR, Authenticated User, System and Administrators in builder.</p>
  
  <p>Thanks for your help.</p>