How to make autostart programmatically with admin permission? I tried
using (var registryKey = Microsoft.Win32.Registry.LocalMachine.OpenSubKey(@"SOFTWARE\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers", true))
+            {
+                registryKey.SetValue(System.Windows.Forms.Application.ExecutablePath, "RUNASADMIN");
+                registryKey.Flush();
+                registryKey.Close();
+            } 
But even UAC window does not appear.