If Process.start contains spaces, add quotes

pull/6384/head
2dust 2024-12-30 19:33:39 +08:00
parent 1dcfe661e9
commit e2b8f4f89a
1 changed files with 3 additions and 0 deletions

View File

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