internal static System.Diagnostics.Process CreateRunAsProcess(string applicationPath, IRunAsDetails runAsDetails)
        {
            if (runAsDetails == null)
                runAsDetails = Configuration.Instance;

            System.Diagnostics.Process process = new System.Diagnostics.Process();
            process.StartInfo = new System.Diagnostics.ProcessStartInfo(RunAsHelper.GetRunAsPath());
            process.StartInfo.Arguments = string.Format(RunAsHelper.RunAsArgumentsFormat, runAsDetails.UserName, runAsDetails.Password, runAsDetails.DomainName, applicationPath);
            process.StartInfo.UseShellExecute = true;
            process.StartInfo.WindowStyle = System.Diagnostics.ProcessWindowStyle.Hidden;

            return process;
        }
 public void Execute(IRunAsDetails runAsDetails)
 {
     RunAsHelper.CreateRunAsProcess(this.Path, runAsDetails).Start();
 }