mirror of
https://github.com/microsoft/PowerToys.git
synced 2025-01-07 20:07:56 +08:00
Better path handeling
Thanks @orzFly
This commit is contained in:
parent
60df499584
commit
a72d1a13b6
@ -101,7 +101,20 @@ 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)
|
||||||
executablePath.FileName = Environment.ExpandEnvironmentVariables(currentKey.OpenSubKey("Shell\\Open\\Command").GetValue(null).ToString());
|
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;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user