diff --git a/views/createView/createExecFile.go b/views/createView/createExecFile.go index b9de93a..089d978 100644 --- a/views/createView/createExecFile.go +++ b/views/createView/createExecFile.go @@ -67,7 +67,7 @@ func CreateExecFile(w fyne.Window) fyne.CanvasObject { dialog.ShowInformation("测试失败", "未填写执行命令", w) return } - ex := exec.Command(info.Cmd) + ex := exec.Command("cmd", "/c", "start", info.Cmd) ex.Dir = filepath.Join(chooseDir, info.Pwd) if err := ex.Start(); err != nil { dialog.ShowInformation("测试失败", err.Error(), w) diff --git a/views/showView/execFile.go b/views/showView/execFile.go index dfdb927..91baa37 100644 --- a/views/showView/execFile.go +++ b/views/showView/execFile.go @@ -34,7 +34,7 @@ func runExecFile(data *models.BaseCard, w fyne.Window) { dialog.ShowInformation("测试失败", err.Error(), w) return } - ex := exec.Command(info.Cmd) + ex := exec.Command("cmd", "/c", "start", info.Cmd) ex.Dir = filepath.Join(cfg.T.CardDir, data.UUID, info.Pwd) if err := ex.Start(); err != nil { dialog.ShowInformation("测试失败", err.Error(), w)