如何在没有 Visual Studio 的情况下在 Windows 7 上安装服务?

2024-01-25

安装Windows服务:Visual Studio有一个util:InstallUtil.exe。 如果我有一个服务 MyService.exe 并且想将其安装在没有 Visual Studio 的 Windows 7 上,我该如何安装它?


一种方法是使用 sc.exe,它是操作系统的一部分。例子:

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

其中 binPath 是包含您的服务的 exe 文件。

如果您不希望启动类型=自动,那么您可以在Windows命令行上使用net start和net stop命令分别启动和停止服务。

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

如何在没有 Visual Studio 的情况下在 Windows 7 上安装服务? 的相关文章

随机推荐