From 39d6ccd11c5101f67f2a142f9f4e0c918a64e4e2 Mon Sep 17 00:00:00 2001 From: Coenraad Stijne Date: Sun, 20 Jul 2014 10:54:12 +0200 Subject: [PATCH] Control Panel Command handeling Now works for everything --- .../ControlPanel/ControlPanelList.cs | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-) diff --git a/Wox.Plugin.SystemPlugins/ControlPanel/ControlPanelList.cs b/Wox.Plugin.SystemPlugins/ControlPanel/ControlPanelList.cs index b2c0153702..7448449822 100644 --- a/Wox.Plugin.SystemPlugins/ControlPanel/ControlPanelList.cs +++ b/Wox.Plugin.SystemPlugins/ControlPanel/ControlPanelList.cs @@ -101,20 +101,10 @@ namespace Wox.Plugin.SystemPlugins.ControlPanel else if (currentKey.OpenSubKey("Shell\\Open\\Command") != null && currentKey.OpenSubKey("Shell\\Open\\Command").GetValue(null) != null) { //Other files (usually third party items) - string value = Environment.ExpandEnvironmentVariables(currentKey.OpenSubKey("Shell\\Open\\Command").GetValue(null).ToString()); - - if (value[0] == '"') - { - for (int x = 1; x < value.Length && value[x] != '"'; x++) - { - executablePath.FileName += value[x]; - } - executablePath.Arguments = value.Remove(0, executablePath.FileName.Length + 2).Trim(); - } - else - { - executablePath.FileName = value; - } + string input = "\"" + Environment.ExpandEnvironmentVariables(currentKey.OpenSubKey("Shell\\Open\\Command").GetValue(null).ToString()) + "\""; + executablePath.FileName = "cmd.exe"; + executablePath.Arguments = "/C " + input; + executablePath.WindowStyle = ProcessWindowStyle.Hidden; } else {