mirror of
https://github.com/microsoft/PowerToys.git
synced 2025-01-18 22:43:31 +08:00
Merge pull request #96 from zlsun/master
Fix the problem of sleep command and change the behavior of executing command.
This commit is contained in:
commit
3f83361a7a
@ -297,6 +297,9 @@ namespace Wox.Infrastructure
|
||||
int driveId = -1;
|
||||
if (PromptForMedia(cmd, out driveId))
|
||||
{
|
||||
string oldCwd = Environment.CurrentDirectory;
|
||||
string home = Environment.GetEnvironmentVariable("HOME");
|
||||
Environment.CurrentDirectory = home;
|
||||
ShellExecCmdLine(
|
||||
IntPtr.Zero,
|
||||
errorDialogHwnd,
|
||||
@ -305,6 +308,7 @@ namespace Wox.Infrastructure
|
||||
global::System.Diagnostics.ProcessWindowStyle.Normal,
|
||||
ShellExecCmdLineFlags.SECL__IGNORE_ERROR | ShellExecCmdLineFlags.SECL_USE_IDLIST | ShellExecCmdLineFlags.SECL_LOG_USAGE | (showErrorDialog ? 0 : ShellExecCmdLineFlags.SECL_NO_UI)
|
||||
);
|
||||
Environment.CurrentDirectory = oldCwd;
|
||||
}
|
||||
else
|
||||
{ // Device not ready 0x80070015
|
||||
|
@ -94,7 +94,7 @@ namespace Wox.Plugin.SystemPlugins
|
||||
Action = (c) =>
|
||||
{
|
||||
ProcessStartInfo Info = new ProcessStartInfo();
|
||||
Info.Arguments = "/C sleep 1 && \"" + Application.ExecutablePath + "\"";
|
||||
Info.Arguments = "/C ping 127.0.0.1 -n 1 && \"" + Application.ExecutablePath + "\"";
|
||||
Info.WindowStyle = ProcessWindowStyle.Hidden;
|
||||
Info.CreateNoWindow = true;
|
||||
Info.FileName = "cmd.exe";
|
||||
|
Loading…
Reference in New Issue
Block a user