/// <summary> /// Executes the file /// </summary> /// <param name="File">File to execute</param> /// <param name="Info">Info used to execute the file</param> /// <returns>The process object created when the executable is started</returns> public static System.Diagnostics.Process Execute(this string File, ProcessStartInfo Info) { File.ThrowIfNullOrEmpty("File"); Info.ThrowIfNull("Info"); Info.FileName = File; return System.Diagnostics.Process.Start(Info); }
/// <summary> /// Executes the file /// </summary> /// <param name="File">File to execute</param> /// <param name="Info">Info used to execute the file</param> /// <returns>The process object created when the executable is started</returns> public static System.Diagnostics.Process Execute(this FileInfo File, ProcessStartInfo Info) { File.ThrowIfNull("File"); if (!File.Exists) throw new FileNotFoundException("File note found", File.FullName); Info.ThrowIfNull("Info"); Info.FileName = File.FullName; return System.Diagnostics.Process.Start(Info); }