private void StartTray() { ApplicationLoader.PROCESS_INFORMATION procInfo; ApplicationLoader.StartProcessAndBypassUAC(@"C:\Windows\System32\notepad.exe", out procInfo); return; ProcessStartInfo info = new ProcessStartInfo(); //info.WorkingDirectory = @"D:\work\source\POC\WinServicesControl\WinServicesControl\bin\Release\"; //info.CreateNoWindow = true; //info.UserName = "******"; //string strPWD = "pronto"; //SecureString password = new SecureString(); //foreach (char c in strPWD.ToCharArray()) //{ password.AppendChar(c); } //info.Password = password; info.FileName = @"D:\work\source\POC\WinServicesControl\WinServicesControl\bin\Release\WinServicesControl.exe"; //info.FileName = @"C:\Windows\System32\notepad.exe"; //info.Arguments = ""; info.WindowStyle = ProcessWindowStyle.Normal; info.UseShellExecute = false; Process pro = Process.Start(info); pro.WaitForExit(); }
protected override void OnStart(string[] args) { String applicationName = "cmd.exe"; // launch the application ApplicationLoader.PROCESS_INFORMATION procInfo; ApplicationLoader.StartProcessAndBypassUAC(applicationName, out procInfo); }
private void button1_Click(object sender, EventArgs e) { ApplicationLoader.PROCESS_INFORMATION procInfo; ApplicationLoader.StartProcessAndBypassUAC(@"C:\Windows\System32\notepad.exe", out procInfo); }