如何启动和停止“自动”过程

时间:2012-08-14 10:57:34

标签: windows service batch-file

我有一个“自动”模式过程说“BPSAuto”。 我需要将进程关闭一段时间,然后重新启动它。

我使用了bat文件并将任务停止并启动。

我用 - > net start BPSAuto ---开始

和 - >净停止BPSAuto ---停止。

现在我的问题是,一旦我停止该过程,它会再次自动启动。可能是因为它处于“自动”模式。 Plesae帮我完全停下来。然后重新启动。

提前致谢...

1 个答案:

答案 0 :(得分:1)

sc config ServiceName start= <setting string>

请注意start =与服务设置

之间的空格

设置字符串可以是以下之一:

  • 引导
  • 系统
  • 自动
  • 需求
  • 禁用

来自sc config /?

Modifies a service entry in the registry and Service Database.
SYNTAX:
sc  config [service name]  ...
CONFIG OPTIONS:
NOTE: The option name includes the equal sign.
 type= <own|share|interact|kernel|filesys|rec|adapt>
 start= <boot|system|auto|demand|disabled>
 error= <normal|severe|critical|ignore>
 binPath= <BinaryPathName>
 group= <LoadOrderGroup>
 tag= <yes|no>
 depend= <Dependencies(separated by / (forward slash))>
 obj= <AccountName|ObjectName>
 DisplayName= <display name>
 password= <password>
相关问题