Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/ssh/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Windows services 关于使用命令提示安装windows服务的混淆_Windows Services - Fatal编程技术网

Windows services 关于使用命令提示安装windows服务的混淆

Windows services 关于使用命令提示安装windows服务的混淆,windows-services,Windows Services,我在.NET2.0中设计了一个简单的windows服务 我正在尝试在本地计算机上部署它。我已切换到设计视图,并设置ServiceInstaller和ServiceProcessInstaller对象。有一个项目安装程序。我还将Windows服务包装到一个.NET安装项目中并进行安装,在指定目录中留下一个.exe 我已启动cmd并输入installutil的路径。这很好,但是我在VisualStudio命令提示符中键入installutil和服务的完整路径,但这不起作用(我也尝试过installu

我在.NET2.0中设计了一个简单的windows服务

我正在尝试在本地计算机上部署它。我已切换到设计视图,并设置ServiceInstaller和ServiceProcessInstaller对象。有一个项目安装程序。我还将Windows服务包装到一个.NET安装项目中并进行安装,在指定目录中留下一个.exe

我已启动cmd并输入installutil的路径。这很好,但是我在VisualStudio命令提示符中键入installutil和服务的完整路径,但这不起作用(我也尝试过installutil/I和各种各样的方法)。权限为本地系统(扩展)

你知道我做错了什么吗?对于这里安装了Windows服务的用户,您的安装方法是什么


谢谢

我们实际上在应用程序中创建了一个内置安装程序。这是一个控制台应用程序,它有一个命令行来安装/卸载服务器,并作为服务或在控制台模式下运行

有关详细信息,请参阅a上的这篇文章。我喜欢这种方法,因为它提供了灵活性

DESCRIPTION: SC is a command line program used for communicating with the NT Service Controller and services. USAGE: sc [command] [service name] ... The option has the form "\\ServerName" Further help on commands can be obtained by typing: "sc [command]" Commands: query-----------Queries the status for a service, or enumerates the status for types of services. queryex---------Queries the extended status for a service, or enumerates the status for types of services. start-----------Starts a service. pause-----------Sends a PAUSE control request to a service. interrogate-----Sends an INTERROGATE control request to a service. continue--------Sends a CONTINUE control request to a service. stop------------Sends a STOP request to a service. config----------Changes the configuration of a service (persistant). description-----Changes the description of a service. failure---------Changes the actions taken by a service upon failure. qc--------------Queries the configuration information for a service. qdescription----Queries the description for a service. qfailure--------Queries the actions taken by a service upon failure. delete----------Deletes a service (from the registry). create----------Creates a service. (adds it to the registry). control---------Sends a control to a service. sdshow----------Displays a service's security descriptor. sdset-----------Sets a service's security descriptor. GetDisplayName--Gets the DisplayName for a service. GetKeyName------Gets the ServiceKeyName for a service. EnumDepend------Enumerates Service Dependencies. The following commands don't require a service name: sc boot------------(ok | bad) Indicates whether the last boot should be saved as the last-known-good boot configuration Lock------------Locks the Service Database QueryLock-------Queries the LockStatus for the SCManager Database EXAMPLE: sc start MyService 说明: SC是一个命令行程序,用于与 NT服务控制器和服务。 用法: sc[命令][服务名称]。。。 该选项的格式为“\\ServerName” 有关命令的更多帮助,请键入:“sc[command]” 命令: 查询----------查询服务的状态,或 枚举服务类型的状态。 queryex-----查询服务的扩展状态,或 枚举服务类型的状态。 启动-----------启动一项服务。 暂停-----------向服务发送暂停控制请求。 询问------向服务发送询问控制请求。 继续------向服务发送继续控制请求。 停止---------向服务发送停止请求。 配置-----------更改服务(persistant)的配置。 描述------更改服务的描述。 故障------更改服务在发生故障时采取的操作。 qc-----------------查询服务的配置信息。 qdescription----查询服务的描述。 qfailure------查询服务失败时采取的操作。 delete------删除服务(从注册表中)。 创建------创建一个服务。(将其添加到注册表中)。 控件------向服务发送控件。 sdshow------显示服务的安全描述符。 sdset-------设置服务的安全描述符。 GetDisplayName——获取服务的DisplayName。 GetKeyName-----获取服务的ServiceKeyName。 EnumDependent-----枚举服务依赖项。 以下命令不需要服务名称: sc boot------(ok | bad)指示是否应执行最后一次引导 保存为最后一个已知的良好引导配置 锁定------------锁定服务数据库 QueryLock-----查询SCManager数据库的锁定状态 例子: sc启动我的服务
下面是另一个特定于.NET服务的参考


我正在我的安装包中调用installutil,它对我来说很好

如果您在运行installutil时发布了一条错误消息,那就太好了