找回密码
 加入
搜索
查看: 3942|回复: 1

[确认非BUG] ServiceControl.au3和服务名

[复制链接]
发表于 2009-9-21 13:17:03 | 显示全部楼层 |阅读模式
本帖最后由 menfan 于 2009-9-21 14:01 编辑

#include <ServiceControl.au3>

Dim $nRet

; 开始/停止服务

If _ServiceExists("", "Symantec AntiVirus") Then
      
   MsgBox(4096,'测试服务' , 'Symantec AntiVirus 服务存在!')   
   If _ServiceRunning("", "Symantec AntiVirus") Then
      MsgBox(4096,'测试服务' , 'Symantec AntiVirus 服务运行')
      If _StopService("", "Symantec AntiVirus") Then
         MsgBox(4096,'测试服务' , 'Symantec AntiVirus 服务停止')
      EndIf
   Else
      MsgBox(4096,'测试服务' , 'Symantec AntiVirus 服务停止')
      If _StartService("", "Symantec AntiVirus") Then
         MsgBox(4096,'测试服务' , 'Symantec AntiVirus 服务开始')
      EndIf
   EndIf
Else
   MsgBox(4096,'测试服务' , 'Symantec AntiVirus服务不存在')   
EndIf

已经找到原因,不是ServiceControl.au3的问题,而是服务名的原因引起的,呵呵。
 楼主| 发表于 2009-9-21 13:17:47 | 显示全部楼层
本帖最后由 menfan 于 2009-9-21 14:29 编辑

目前ServiceControl.au3支持带空格的服务名(加双引号即可,另注:SC QUERY可查服务名),但是服务名一定要正确:)呵呵
您需要登录后才可以回帖 登录 | 加入

本版积分规则

QQ|手机版|小黑屋|AUTOIT CN ( 鲁ICP备19019924号-1 )谷歌 百度

GMT+8, 2024-3-29 06:16 , Processed in 0.067890 second(s), 19 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表