Error 5 : Access Denied when starting windows service

前端 未结 30 2487
滥情空心
滥情空心 2020-12-04 18:49

I\'m getting this error when I try to start a windows service I\'ve created in C#:

\"alt

My Code

30条回答
  •  生来不讨喜
    2020-12-04 19:06

    I was getting this error because I misread the accepted answer from here: Create Windows service from executable.

    sc.exe create  binPath= ""
    

    For , I was using the path of the executable's folder, e.g. C:\Folder.

    It needs to be the path of the executable, e.g. C:\Folder\Executable.exe.

提交回复
热议问题