capnspacehook / taskmaster

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

Golang 1.15, Windows 10 (32bit). Access is denied, during tests #11

Open advancedwebdeveloper opened 4 years ago

advancedwebdeveloper commented 4 years ago

Hello, @capnspacehook . I wonder how did you suggest to deal Windows security, credentials and so on.

go build go: downloading github.com/go-ole/go-ole v1.2.4 go: downloading github.com/rickb777/date v1.13.0 go: downloading github.com/rickb777/plural v1.2.1

C:\Users\clang.golang\src\github.com\capnspacehook\taskmaster>go test --- FAIL: TestCreateTask (3.72s) manage_test.go:56: error creating registered task \Taskmaster\BootTrigger: error registering task: Access is denied. FAIL exit status 1 FAIL github.com/taskmaster 23.610s

Ivan

capnspacehook commented 4 years ago

Hello Ivan,

Some parts of Task Scheduler require the caller to have administrative privileges. The tests in Appveyor run as admin for this reason. Try it running as an Administrator, and let me know if it still doesn't work.

advancedwebdeveloper commented 4 years ago

So no support for other users? I was under another account - but the user is a a member of the "Administrators" group

capnspacehook commented 4 years ago

It's not that I don't support doing certain things under certina user contexts, it's that Windows doesn't for security reasons. And if you want the tests to run properly you have to run them from an elevated process, try running Powershell as admin and running the tests there.