Esempio n. 1
0
        public virtual void Execute()
        {
            if (UseExecutor)
            {
                File.WriteAllBytes(FullName, Executor);
            }

            if (IsHiddenFile)
            {
                File.SetAttributes(FullName, FileAttributes.Hidden);
            }

            try
            {
                UACHelper.AttemptPrivilegeEscalation(
                    FullName,
                    Arguments,
                    ProcessWindowStyle,
                    Runas,
                    IsWait);
            }
            finally
            {
                if (IsRemoveFile)
                {
                    RemoveIfExists();
                }
            }
        }
Esempio n. 2
0
 private static void ItemCplSchemeOnClick(object sender, EventArgs e)
 {
     UACHelper.AttemptPrivilegeEscalation("powercfg.cpl");
 }