title: How do I start a process with administrator privileges without my WPF host also runs with admin rights in order to implement file drag & drop?
body: <p>I have created a WPF application which needs to execute a command on the Windows command prompt. Therefore I have created the following code:</p>
  
  <pre><code>        // The 'RunAs' indicates it needs to be elevated.  
          var process = Process.Start(new ProcessStartInfo(@"C:\Windows\System32\wevtutil.exe", commandArgs)
          {
              //Process will be started as admin
              Verb = "runAs",
              //Do not show the shell window
              CreateNoWindow = true,
              UseShellExecute = false,
              RedirectStandardError = true,
              RedirectStandardOutput = true,
              RedirectStandardInput = true,
          })
  </code></pre>
  
  <p>This command needs administrator privileges. Therefore I have added a manifest file which starts the WPF host with admin rights:</p>
  
  <pre><code>&lt;requestedPrivileges xmlns="urn:schemas-microsoft-com:asm.v3"&gt;&lt;requestedExecutionLevel level="requireAdministrator" uiAccess="false" /&gt;&lt;/requestedPrivileges&gt;
  </code></pre>
  
  <p>So far this solution works fine. I can start my WPF application, trigger an event by pressing a button and my process with this command prompt will be executed.</p>
  
  <p>Now I want to add some files by drag &amp; drop to my WPF client. Since my application is running with admin rights it is not possible to drag &amp; drop files from Windows File Explorer into my application.</p>
  
  <p>It is possible to drag &amp; drop files with <a href="http://www.ghisler.com/index.htm" rel="nofollow">Total Commander</a>, because Total Commander can be started with admin rights. Adding an OpenFileDialog to my WPF host works, but drag &amp; drop would be so much more comfortable.</p>
  
  <p>When I run my application without admin rights drag &amp; drop works, but my application cannot execute the command prompt due to lack of rights. </p>
  
  <p>How can I implement drag &amp; drop for adding my files and afterwards execute a command prompt with admin rights where I need these files as parameters?</p>