From e2b8f4f89ab8e3da683fed9e54e3112e20c32278 Mon Sep 17 00:00:00 2001 From: 2dust <31833384+2dust@users.noreply.github.com> Date: Mon, 30 Dec 2024 19:33:39 +0800 Subject: [PATCH] If Process.start contains spaces, add quotes --- v2rayN/ServiceLib/Common/Utils.cs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/v2rayN/ServiceLib/Common/Utils.cs b/v2rayN/ServiceLib/Common/Utils.cs index 31495e4a..4d4665ea 100644 --- a/v2rayN/ServiceLib/Common/Utils.cs +++ b/v2rayN/ServiceLib/Common/Utils.cs @@ -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)