Esempio n. 1
0
        public bool ShellRun(string cmd, bool runAsAdministrator = false)
        {
            try
            {
                if (string.IsNullOrEmpty(cmd))
                {
                    throw new ArgumentNullException();
                }

                WindowsShellRun.Start(cmd, runAsAdministrator);
                return(true);
            }
            catch (Exception ex)
            {
                ShowMsg("Could not start " + cmd, ex.Message, null);
            }
            return(false);
        }
Esempio n. 2
0
        public bool ShellRun(string cmd, bool runAsAdministrator = false)
        {
            try
            {
                if (string.IsNullOrEmpty(cmd))
                {
                    throw new ArgumentNullException();
                }

                WindowsShellRun.Start(cmd, runAsAdministrator);
                return(true);
            }
            catch (Exception ex)
            {
                string errorMsg = string.Format(InternationalizationManager.Instance.GetTranslation("couldnotStartCmd"), cmd);
                ShowMsg(errorMsg, ex.Message, null);
            }
            return(false);
        }