Expand EnvironmentVariable in Command

This commit is contained in:
Kevin Zhang 2021-10-30 00:11:17 -05:00
parent 7cfb71df35
commit 304fb90c5d

View file

@ -150,12 +150,8 @@ namespace Flow.Plugin.WindowsSettings.Helper
ProcessStartInfo processStartInfo;
var command = entry.Command;
if (command.Contains("%windir%", StringComparison.InvariantCultureIgnoreCase))
{
var windowsFolder = Environment.GetFolderPath(Environment.SpecialFolder.Windows);
command = command.Replace("%windir%", windowsFolder, StringComparison.InvariantCultureIgnoreCase);
}
command = Environment.ExpandEnvironmentVariables(command);
if (command.Contains(' '))
{