diff --git a/v2rayN/v2rayN/Common/Utils.cs b/v2rayN/v2rayN/Common/Utils.cs index d98d9a7a..64df907e 100644 --- a/v2rayN/v2rayN/Common/Utils.cs +++ b/v2rayN/v2rayN/Common/Utils.cs @@ -1029,14 +1029,14 @@ namespace v2rayN if (run) { - string exePath = $"\"{GetExePath()}\""; + string exePath = GetExePath(); if (IsAdministrator()) { AutoStart(autoRunName, exePath, ""); } else { - RegWriteValue(AutoRunRegPath, autoRunName, exePath); + RegWriteValue(AutoRunRegPath, autoRunName, exePath.AppendQuotes()); } } } @@ -1136,7 +1136,7 @@ namespace v2rayN task.Settings.ExecutionTimeLimit = TimeSpan.Zero; task.Triggers.Add(new LogonTrigger { UserId = logonUser, Delay = TimeSpan.FromSeconds(10) }); task.Principal.RunLevel = TaskRunLevel.Highest; - task.Actions.Add(new ExecAction(deamonFileName, null, Path.GetDirectoryName(deamonFileName))); + task.Actions.Add(new ExecAction(deamonFileName.AppendQuotes(), null, Path.GetDirectoryName(deamonFileName))); taskService.RootFolder.RegisterTaskDefinition(TaskName, task); }