Beispiel #1
0
        public static bool Escalate(string[] Args)
        {
            if (Privileges.IsAdministrator())
            {
                if (Args.Length == 1 && Args[0] == EscalateCommandLineArg)
                {
                    Process.Start(FilePath.GetProcessExePath());
                    Environment.Exit(0);
                }
                else
                {
                    return(true);
                }
            }
            else
            {
                ElevateFile(string.Format("{0} {1}", FilePath.GetProcessExePath(), EscalateCommandLineArg));
                Environment.Exit(0);
            }

            return(false);
        }