mirror of
https://github.com/microsoft/PowerToys.git
synced 2025-01-18 14:41:21 +08:00
Opening explorer if the user has types a file path.
This commit is contained in:
parent
44943feb8b
commit
86f209a302
@ -192,6 +192,13 @@ namespace Wox.Plugin.Shell
|
||||
info = ShellCommand.SetProcessStartInfo("powershell.exe", workingDirectory, arguments, runAsAdministratorArg);
|
||||
}
|
||||
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);
|
||||
if (parts.Length == 2)
|
||||
@ -212,6 +219,7 @@ namespace Wox.Plugin.Shell
|
||||
info = ShellCommand.SetProcessStartInfo(command, verb: runAsAdministratorArg);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
|
Loading…
Reference in New Issue
Block a user