title: C# Replace File in System32 Unauthorized Access
body: <p>I am trying to replace a file in the <code>C:\Windows\System32</code> directory but it won't work.</p>
  
  <p>(For them who mean my program is a virus: No, it isn't!)</p>
  
  <p>Some information about the environment:</p>
  
  <ul>
  <li>Windows 7 SP1 </li>
  <li>Visual Studio 2012</li>
  <li>C# WPF Program</li>
  </ul>
  
  <p>I've already added the application manifest and changed the <code>requestedExecutionLevel</code>.</p>
  
  <pre><code>&lt;requestedExecutionLevel level="requireAdministrator" uiAccess="false" /&gt;
  </code></pre>
  
  <p>I have also tried to use a BATCH to replace the file but I get the same error.</p>
  
  <p>Is there any way to replace the file?</p>
  
  <p>For example explicitly ask for <code>FileIOPermissions.Write</code> or <code>.AllAccess</code>.</p>