Opening explorer if the user has types a file path.

This commit is contained in:
ryanbodrug-microsoft
2020-04-22 17:50:38 -07:00
parent 44943feb8b
commit 86f209a302

View File

@@ -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();