This looks pretty simple. Just add a value to the registry.
Key: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers
-or- HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers
Name: f:\ull\path\to\executable.exe
Value: RUNASADMIN
Here's how you would do this in code. If you write to HKCU, the calling process will not need to be running as Administrator.
static void SetRunAsAdmin(string exeFilePath)
{
var key = Registry.CurrentUser.OpenSubKey(@"SOFTWARE\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers", true);
if (key == null)
throw new InvalidOperationException(@"Cannot open registry key HKCU\SOFTWARE\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers.");
using (key)
key.SetValue(exeFilePath, "RUNASADMIN");
}