我想使用Windows命令提示符(而不是Visual Studio命令提示符)安装Windows服务。
我怎么做呢?
我想使用Windows命令提示符(而不是Visual Studio命令提示符)安装Windows服务。
我怎么做呢?
当前回答
1.从开始菜单中,选择Visual Studio目录,然后为VS选择开发人员命令提示符。
2.出现Visual Studio的开发人员命令提示符。
3.访问项目已编译的可执行文件所在的目录。
4.以项目的可执行文件作为参数,从命令提示符运行InstallUtil.exe
其他回答
以管理员身份运行Windows命令提示符 cd C:\Windows\Microsoft.NET\Framework\v4.0.30319\到文件夹 installutil C:\ProjectFolder\bin\Debug\MyProject.exe
卸载方法:installutil /u C:\ProjectFolder\bin\Debug\MyProject.exe
以下代码,安装和卸载服务,
打开命令提示符,以管理员身份运行程序,输入以下命令并按enter。
语法
安装
C:\windows\microsoft.net\framework\v4.0.30319>InstallUtil.exe + Your copied path + \your service name + .exe
我们的道路 InstallUtil.exe C: \ MyFirstService \ bin \ \ MyFirstService.exe调试
要卸载
C:\windows\microsoft.net\framework\v4.0.30319>InstallUtil.exe -u + Your copied path + \your service name + .exe
例如:我们的路径InstallUtil.exe -u C:\MyFirstService\bin\Debug\MyFirstService.exe
要获得更多帮助,您可以查看以下链接:示例程序
您可以使用命令提示符并写入: C:\windows\microsoft.net\framework\v4.0.30319\InstallUtil.exe -i " windows服务的exe文件"
以管理员权限启动命令提示符(CMD)。 输入c:\windows\microsoft.net\framework\v4.0.30319\installutil.exe[你的windows服务路径到exe] 按return键
您应该打开命令提示符,转到
C:\windows\microsoft.net\framework\v4.0.30319\InstallUtil.exe -i " windows服务的exe文件"