0

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.

Alexey
  • 9
  • 2

0 Answers0