If Process.start contains spaces, add quotes

This commit is contained in:
2dust 2024-12-30 19:33:39 +08:00
parent 1dcfe661e9
commit e2b8f4f89a

View file

@ -593,6 +593,9 @@ namespace ServiceLib.Common
return; return;
} }
if (fileName.Contains(' ')) fileName = fileName.AppendQuotes();
if (arguments.Contains(' ')) arguments = arguments.AppendQuotes();
Process.Start(new ProcessStartInfo(fileName, arguments) { UseShellExecute = true }); Process.Start(new ProcessStartInfo(fileName, arguments) { UseShellExecute = true });
} }
catch (Exception ex) catch (Exception ex)