| 关键词: 命令 psservice 服务 但是 东里 servicename 比如说 setconfig disabled 输入 |
大家都知道开启和停止服务要用命令net start servicename和net stop servicename吧 但是怎么才能在命令行下设置一个服务的启动状态呢?比如说禁用它? 系统自带的东东里可能有,但是我没研究过,我只说pstools里带的psservice命令 在命令行下输入psservice/?命令可以看到使用说明: Usage: psservice [\\Computer [-u Username [-p Password]]] <cmd> <optns>Cmd is one of the following:query Queries the status of a serviceconfig Queries the configurationstart Starts a servicestop Stops a servicerestart Stops and then restarts a servicepause Pauses a servicecont Continues a paused servicedepend Enumerates the services that depend on the one specifiedfind Searches for an instance of a service on the network 这是psservice命令的参数列表,但是今天我们用到的是这个列表里没有出现的一个参数: setconfig 比如说要禁用Uninterruptible Power Supply服务(UPS),我们知道它的服务名称是UPS,那么只要输入以下命令: psservice setconfig ups disabled 就可以把这个服务禁用掉了 其中的disabled可以换成auto和demand,分别是对应自动和手动 |
|
声明:文章版权归原作者所有 部分文章转自互联网 如有侵权请联系
[邮箱地址] 删除
|