I try to create a schedule, but I always get the error (exit status 0x80004005) when I run the
package main
import (
"fmt"
"os/exec"
)
func main() {
cmd := exec.Command("schtasks.exe", "/Create",
"/SC ONLOGON",
"/TN MyTask",
)
if err := cmd.Run(); err != nil {
fmt.Println(err.Error())
}
}
Even if I run it with administrator privileges, I still get the same result.
How do I solve it, or is there any other way?