public static void Run(CustomCommandInfo info) { if (string.IsNullOrEmpty(info.Arguments)) { Process.Start(info.FilePath); } else { Process.Start(info.FilePath, info.Arguments); } }
/// <summary> /// Method to execute a <see cref="CustomCommandInfo"/>. /// </summary> /// <param name="info"><see cref="CustomCommandInfo"/> which is executed.</param> public static void Run(CustomCommandInfo info) { var processStartInfo = new ProcessStartInfo() { FileName = info.FilePath, UseShellExecute = true }; if (!string.IsNullOrEmpty(info.Arguments)) { processStartInfo.Arguments = info.Arguments; } Process.Start(processStartInfo); }
public static void Run(CustomCommandInfo info) { try { if (string.IsNullOrEmpty(info.Arguments)) { Process.Start(info.FilePath); } else { Process.Start(info.FilePath, info.Arguments); } } catch (Exception ex) { MessageBox.Show(ex.Message, "Error in Utilities.CustomCommand.Run()", MessageBoxButton.OK, MessageBoxImage.Error); } }