From 92ad495ff79b8dfbfebfee0eaa8ad0f9002220d9 Mon Sep 17 00:00:00 2001 From: "heidi.ngew" Date: Thu, 22 Dec 2022 09:04:18 -0500 Subject: [PATCH 1/4] feat: add wait for windows start cmd --- open/exec_windows.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/open/exec_windows.go b/open/exec_windows.go index 6e46c00..f137527 100644 --- a/open/exec_windows.go +++ b/open/exec_windows.go @@ -21,7 +21,7 @@ func cleaninput(input string) string { } func open(input string) *exec.Cmd { - cmd := exec.Command(runDll32, cmd, input) + cmd := exec.Command("start", input, "/wait") //cmd.SysProcAttr = &syscall.SysProcAttr{HideWindow: true} return cmd } From e1194fff66bc2a9c9638d0dcfbb4f922975e4f1d Mon Sep 17 00:00:00 2001 From: "heidi.ngew" Date: Thu, 22 Dec 2022 10:45:13 -0500 Subject: [PATCH 2/4] fix: cmd sequence --- open/exec_windows.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/open/exec_windows.go b/open/exec_windows.go index f137527..583425e 100644 --- a/open/exec_windows.go +++ b/open/exec_windows.go @@ -21,7 +21,7 @@ func cleaninput(input string) string { } func open(input string) *exec.Cmd { - cmd := exec.Command("start", input, "/wait") + cmd := exec.Command("start", "/wait", input) //cmd.SysProcAttr = &syscall.SysProcAttr{HideWindow: true} return cmd } From 557efb952abe6a22b12f945dd1c649445b573991 Mon Sep 17 00:00:00 2001 From: "heidi.ngew" Date: Thu, 22 Dec 2022 15:58:36 -0500 Subject: [PATCH 3/4] fix: start cmd in full path --- open/exec_windows.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/open/exec_windows.go b/open/exec_windows.go index 583425e..b3a1247 100644 --- a/open/exec_windows.go +++ b/open/exec_windows.go @@ -12,7 +12,7 @@ import ( var ( cmd = "url.dll,FileProtocolHandler" - runDll32 = filepath.Join(os.Getenv("SYSTEMROOT"), "System32", "rundll32.exe") + // start = filepath.Join(os.Getenv("SYSTEMROOT"), "System32", "start.exe") ) func cleaninput(input string) string { @@ -21,7 +21,7 @@ func cleaninput(input string) string { } func open(input string) *exec.Cmd { - cmd := exec.Command("start", "/wait", input) + cmd := exec.Command("cmd", "/C", "start", "/wait", cleaninput(input)) //cmd.SysProcAttr = &syscall.SysProcAttr{HideWindow: true} return cmd } From c5f05b397ac5219138f2ba05c8fba1bca11f1797 Mon Sep 17 00:00:00 2001 From: "heidi.ngew" Date: Thu, 22 Dec 2022 16:32:52 -0500 Subject: [PATCH 4/4] fix: remove unused model --- open/exec_windows.go | 2 -- 1 file changed, 2 deletions(-) diff --git a/open/exec_windows.go b/open/exec_windows.go index b3a1247..4861e1c 100644 --- a/open/exec_windows.go +++ b/open/exec_windows.go @@ -3,9 +3,7 @@ package open import ( - "os" "os/exec" - "path/filepath" "strings" // "syscall" )