Replace tskill with taskkill
This offers a more reliable way of killing a process. The /IM flag
allows us to specify the "image name" of the process we're killing.
This means we can use wildcards, foce kill a process and all the child
processes it may have spawned.
@@ -364,7 +364,7 @@ func Randomize(str string) string {
func KillProcess(name string) error {
var command []string
if goruntime.GOOS == "windows" {
- command = []string{"tskill", strings.TrimSuffix(name, ".exe")}
+ command = []string{"taskkill", "/IM", name, "/F"}
} else {
command = []string{"pkill", "-x", fmt.Sprintf("^%s$", name)}
}
