title: C# Run Remote Desktop Application as Administrator
body: <p>I have a code that launches remote IE. I wish to launch the application with "run as admin" option.<br/>How can this be achieved?</p>
  
  <pre><code>private static void StartSession(string hostName)
  {
      var filespec = Path.Combine(GetRootFolderSpec(), "session.rdp");
  
      if (File.Exists(filespec)) File.Delete(filespec);
      var settings = GetRdpSettings(hostName);
      File.WriteAllText(filespec, settings);
      File.SetAttributes(filespec, FileAttributes.Hidden);
      Process.Start(filespec);
  }
  
  private static string GetRdpSettings(string hostName)
  {
      return @"redirectclipboard:i:1
      redirectposdevices:i:0
      redirectprinters:i:0
      redirectcomports:i:1
      redirectsmartcards:i:0
      devicestoredirect:s:
      drivestoredirect:s:
      session bpp:i:32
      prompt for credentials on client:i:1
      span monitors:i:1
      use multimon:i:1
      remoteapplicationmode:i:1
      server port:i:1111
      allow font smoothing:i:1
      screen mode id:i:1
      smart sizing:i:1
      promptcredentialonce:i:1
      authentication level:i:2
      gatewayusagemethod:i:2
      gatewayprofileusagemethod:i:0
      gatewaycredentialssource:i:0
      full address:s:" + hostName + @"
      alternate shell:s:||iexplore
      remoteapplicationprogram:s:||iexplore
      gatewayhostname:s:
      remoteapplicationname:s:iexplore.exe
      remoteapplicationcmdline:s:";
  }
  </code></pre>