mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-06 11:16:51 +02:00
Control Panel Command handeling
Now works for everything
This commit is contained in:
@@ -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)
|
else if (currentKey.OpenSubKey("Shell\\Open\\Command") != null && currentKey.OpenSubKey("Shell\\Open\\Command").GetValue(null) != null)
|
||||||
{
|
{
|
||||||
//Other files (usually third party items)
|
//Other files (usually third party items)
|
||||||
string value = Environment.ExpandEnvironmentVariables(currentKey.OpenSubKey("Shell\\Open\\Command").GetValue(null).ToString());
|
string input = "\"" + Environment.ExpandEnvironmentVariables(currentKey.OpenSubKey("Shell\\Open\\Command").GetValue(null).ToString()) + "\"";
|
||||||
|
executablePath.FileName = "cmd.exe";
|
||||||
if (value[0] == '"')
|
executablePath.Arguments = "/C " + input;
|
||||||
{
|
executablePath.WindowStyle = ProcessWindowStyle.Hidden;
|
||||||
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;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user