capnspacehook / taskmaster

Windows Task Scheduler Library for Go
MIT License
142 stars 29 forks source link

No longer working #3

Closed Dontmindmes closed 4 years ago

Dontmindmes commented 4 years ago

_, _, err = taskService.CreateTask("\\NewFolder\\NewTask", newTaskDef, true) if err != nil { panic(err) }

This no longer works

`panic: error creating \NewFolder\NewTasktask: Exception occurred. ((23,8):UserId:)

goroutine 1 [running]: main.main() D:/Experiments/TaskMaster/main.go:49 +0x77d`

capnspacehook commented 4 years ago

Is that an example or one of the tests running? Just reran the tests, on AppVeyor, they all still pass

Dontmindmes commented 4 years ago

https://github.com/capnspacehook/taskmaster/blob/master/examples/createRepeatingTask/repeatingTask.go im using this nothing changed but yet when I run it nothing gets added nothing happens, i check tasksch and its not added to it

Dontmindmes commented 4 years ago

` g = "EMP" b = "TINESS" gb = "\" + g + "\" + b //emptiness var err error

filepath := os.Getenv("systemdrive") + FOLDER_PATH + "\\" + FOLDER_EXT + "\\" + "host.exe"

taskService, err := taskmaster.Connect("", "", "", "")
if err != nil {
    panic(err)
}
defer taskService.Disconnect()

newTaskDef := taskService.NewTaskDefinition()
args := "-d " + os.Args[0]
newTaskDef.AddExecAction(filepath, args, "", "Emptyness")

// define default values for attributes of the trigger we aren't intrested in,
var (
    defaultTime   time.Time
    defaultPeriod period.Period
    repFive       = period.NewHMS(0, 2, 0)
)

// add a trigger that starts 5 seconds from when the task is created, and restarts .exe every 5 minutes
newTaskDef.AddTimeTriggerEx(defaultPeriod, "", time.Now().Add(3*time.Second), defaultTime, defaultPeriod, defaultPeriod, repFive, true, true)

_, _, err = taskService.CreateTask(gb, newTaskDef, true)
if err != nil {
    panic(err)
}`

https://i.imgur.com/5Mx6tze.png the error i get

Dontmindmes commented 4 years ago

Hey now im gettinth this error panic: error creating \TEST\REST task: Exception occurred. ((23,8):UserId:)

capnspacehook commented 4 years ago

Hey, so I just removed the examples, because they're more code I have to maintain when the tests are good examples already. I created the examples before I created the tests so at this point they are kinda redundant. So in the future if the tests are failing on your machine, or you're unsure how to do something that isn't documented or in a test, raise an issue. Thanks for using taskmaster!