How to install a service on windows 7 without Visual Studio?

喜你入骨 提交于 2019-12-04 10:58:39
user1899501

You can try NSSM (Non-Sucking Service Manager) for the times the "sc" doesn't work quite as expected. http://nssm.cc

I had an service I built in Go not too long ago that I could not get to run under "sc", nssm worked perfectly.

seva titov

One way is to use sc.exe, which is part of OS. Example:

sc create **ServiceName** start= auto binPath= "c:\mydir\myService.exe"

where binPath is exe file containing your service.

if you don't want start type = automatic then you can use net start and net stop command on command line of windows to start and stop service respectively.

you can find installUtil.exe at "C:\Windows\Microsoft.NET\Framework\v2.0.50727", launch from CMD prompt, and add the path to your service

Couldn't get NSSM to work on my W7. It always put its own path as the path to the program I put in the Path box. Had to go manual with the sc example above. That worked perfectly. To get a list of sc parameters, just execute sc. The two * preceeding the ServiceName will cause the ServiceName to appear at the top of the C:\Windows\System32\compmgmt.msc list. To remove a service, use sc delete ServiceName. You will have focus the list and use the Refresh menu item to see the change in compmgmt.msc.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!