public static bool ConvertFile(ConvertParams oldparams, ConvertParams newparams, Thumb thumb) { if (File.Exists(newparams.filepath)) return false; string parameters = String.Format("-o \"{0}\" -overwrite -quiet -out {3} -ratio -resize {2} 0 \"{1}\"", newparams.filepath, oldparams.filepath, thumb.width, newparams.IsPng() ? "png" : "jpeg"); ProcessStartInfo info = new ProcessStartInfo("nconvert.exe", parameters); info.CreateNoWindow = true; info.WindowStyle = ProcessWindowStyle.Hidden; Process proc = Process.Start(info); proc.WaitForExit(); return true; }