From 7dfd0493afd5853941ff245dcb26b0cf9a908216 Mon Sep 17 00:00:00 2001 From: MysticBoy Date: Thu, 2 Apr 2020 17:45:37 +0800 Subject: [PATCH] https://stackoverflow.com/questions/7693429/process-start-to-open-an-url-getting-an-exception --- shadowsocks-csharp/Util/Util.cs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/shadowsocks-csharp/Util/Util.cs b/shadowsocks-csharp/Util/Util.cs index 81ea61e5..79dd63f7 100755 --- a/shadowsocks-csharp/Util/Util.cs +++ b/shadowsocks-csharp/Util/Util.cs @@ -279,8 +279,11 @@ namespace Shadowsocks.Util // hack because of this: https://github.com/dotnet/corefx/issues/10361 if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows)) { - url = url.Replace("&", "^&"); - Process.Start(new ProcessStartInfo("cmd", $"/c start {url}") { CreateNoWindow = true }); + Process.Start(new ProcessStartInfo(url) + { + UseShellExecute = true, + Verb = "open" + }); } else if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux)) {