I have a total simple program, that has 1 button, which i want to run an exe as a process, with elevated admin rights. I spent an hour by now to google out the working soultion for that, but everywhere i see the same solutions and still dont work. Help me im getting mad :D
the code:
using System;
using System.Diagnostics;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace WindowsFormsApplication1
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
Process gcxstart = new Process();
gcxstart.StartInfo.FileName = @"d:\test\launch.exe";
gcxstart.StartInfo.WindowStyle = ProcessWindowStyle.Hidden;
gcxstart.StartInfo.Verb = "runas";
gcxstart.Start();
}
}
}
I have no idea why everybody can have it working with the .verb = "runas" method and mine still dont want to work.
OS: win7
Visual studio 2008 C# express edition
Please help me before i cut my veins ::)