mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-11 05:52:19 +02:00
Opening explorer if the user has types a file path.
This commit is contained in:
@@ -192,6 +192,13 @@ namespace Wox.Plugin.Shell
|
|||||||
info = ShellCommand.SetProcessStartInfo("powershell.exe", workingDirectory, arguments, runAsAdministratorArg);
|
info = ShellCommand.SetProcessStartInfo("powershell.exe", workingDirectory, arguments, runAsAdministratorArg);
|
||||||
}
|
}
|
||||||
else if (_settings.Shell == Shell.RunCommand)
|
else if (_settings.Shell == Shell.RunCommand)
|
||||||
|
{
|
||||||
|
//Open explorer if the path is a file or directory
|
||||||
|
if(Directory.Exists(command) || File.Exists(command))
|
||||||
|
{
|
||||||
|
info = ShellCommand.SetProcessStartInfo("explorer.exe", arguments: command, verb: runAsAdministratorArg);
|
||||||
|
}
|
||||||
|
else
|
||||||
{
|
{
|
||||||
var parts = command.Split(new[] { ' ' }, 2);
|
var parts = command.Split(new[] { ' ' }, 2);
|
||||||
if (parts.Length == 2)
|
if (parts.Length == 2)
|
||||||
@@ -212,6 +219,7 @@ namespace Wox.Plugin.Shell
|
|||||||
info = ShellCommand.SetProcessStartInfo(command, verb: runAsAdministratorArg);
|
info = ShellCommand.SetProcessStartInfo(command, verb: runAsAdministratorArg);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
throw new NotImplementedException();
|
throw new NotImplementedException();
|
||||||
|
|||||||
Reference in New Issue
Block a user