返回列表 发帖

[AU3基础] ServiceControl.au3和Services.au3是不是有冲突?

ServiceControl.au3和Services.au3我都是从github的SVN上弄下来的。

现在我遇到了当年这位大哥一样的问题,这位大哥发帖了,但是也没得到回应。。。
我也试着把ServiceControl.au3和Services.au3前后顺序调转过,输出都是大量的变量名被重复命名结果。
传送门:http://www.autoit3.cn/viewthread ... ight=ServiceControl

这是我的测试代码,为免去一些麻烦,我把服务名修改了,大家懂是什么服务就好了。。。

如果按目前ServiceControl.au3和Services.au3关系,问题是无法解决的,那么就求助各位看看有没有其它办法达成目的?
  1. #include <ServiceControl.au3>
  2. #include <Services.au3>

  3. If _ServGetState('OpenV1P1N1Service') = "Running" Then
  4.    MsgBox(0, 0, 'OpenV1P1N1Service Is Running')   
  5.   Else
  6.    MsgBox(0, 0, 'OpenV1P1N1Service Is NOT Running')
  7.    ;这里最终目的是使用_service_start('OpenV1P2N3Service')开启服务
  8. EndIf
复制代码
目前调试输出:

>"C:\Program Files (x86)\AutoIt3\SciTE\AutoIt3Wrapper\AutoIt3Wrapper.exe" /run /prod /ErrorStdOut /in "C:\Users\lwk\Desktop\serice.au3" /UserParams   
+>15:48:17 启动 AutoIt3Wrapper v17.224.935.0 SciTE v.3.7.3.0   键盘:00000804  操作系统:WIN_7/Service Pack 1  CPU:X64  系统架构:X64
+> 语言环境: 0804  系统代码页:936        UTF8 检查模式: 4 # 检测 ascii 码高字符,如未发现则默认设置编码为 UTF8 无 BOM        脚本编码: 256 UTF8 无 BOM
+> SciTE 目录 => C:\Program Files (x86)\AutoIt3\SciTE  AutoIt3Wrapper 用户目录 => C:\Users\lwk\AppData\Local\AutoIt v3\SciTE\AutoIt3Wrapper   SciTE 用户目录 => C:\Users\lwk\AppData\Local\AutoIt v3\SciTE
>运行 AU3Check (3.3.14.2)  程序路径: C:\Program Files (x86)\AutoIt3  脚本路径: C:\Users\lwk\Desktop\serice.au3
"C:\Program Files (x86)\AutoIt3\Include\Services.au3"(71,42) : 错误: $SC_MANAGER_CONNECT 变量先前已声明为非常量.
Global Const $SC_MANAGER_CONNECT = 0x0001
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
"C:\Program Files (x86)\AutoIt3\Include\Services.au3"(72,49) : 错误: $SC_MANAGER_CREATE_SERVICE 变量先前已声明为非常量.
Global Const $SC_MANAGER_CREATE_SERVICE = 0x0002
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
"C:\Program Files (x86)\AutoIt3\Include\Services.au3"(73,52) : 错误: $SC_MANAGER_ENUMERATE_SERVICE 变量先前已声明为非常量.
Global Const $SC_MANAGER_ENUMERATE_SERVICE = 0x0004
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
"C:\Program Files (x86)\AutoIt3\Include\Services.au3"(74,39) : 错误: $SC_MANAGER_LOCK 变量先前已声明为非常量.
Global Const $SC_MANAGER_LOCK = 0x0008
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
"C:\Program Files (x86)\AutoIt3\Include\Services.au3"(75,52) : 错误: $SC_MANAGER_QUERY_LOCK_STATUS 变量先前已声明为非常量.
Global Const $SC_MANAGER_QUERY_LOCK_STATUS = 0x0010
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
"C:\Program Files (x86)\AutoIt3\Include\Services.au3"(76,53) : 错误: $SC_MANAGER_MODIFY_BOOT_CONFIG 变量先前已声明为非常量.
Global Const $SC_MANAGER_MODIFY_BOOT_CONFIG = 0x0020
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
"C:\Program Files (x86)\AutoIt3\Include\Services.au3"(78,46) : 错误: $SC_MANAGER_ALL_ACCESS 变量先前已声明为非常量.
Global Const $SC_MANAGER_ALL_ACCESS = 0xF003F
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
"C:\Program Files (x86)\AutoIt3\Include\Services.au3"(88,44) : 错误: $SERVICE_QUERY_CONFIG 变量先前已声明为非常量.
Global Const $SERVICE_QUERY_CONFIG = 0x0001
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
"C:\Program Files (x86)\AutoIt3\Include\Services.au3"(89,45) : 错误: $SERVICE_CHANGE_CONFIG 变量先前已声明为非常量.
Global Const $SERVICE_CHANGE_CONFIG = 0x0002
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
"C:\Program Files (x86)\AutoIt3\Include\Services.au3"(90,44) : 错误: $SERVICE_QUERY_STATUS 变量先前已声明为非常量.
Global Const $SERVICE_QUERY_STATUS = 0x0004
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
"C:\Program Files (x86)\AutoIt3\Include\Services.au3"(91,52) : 错误: $SERVICE_ENUMERATE_DEPENDENTS 变量先前已声明为非常量.
Global Const $SERVICE_ENUMERATE_DEPENDENTS = 0x0008
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
"C:\Program Files (x86)\AutoIt3\Include\Services.au3"(92,37) : 错误: $SERVICE_START 变量先前已声明为非常量.
Global Const $SERVICE_START = 0x0010
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
"C:\Program Files (x86)\AutoIt3\Include\Services.au3"(93,36) : 错误: $SERVICE_STOP 变量先前已声明为非常量.
Global Const $SERVICE_STOP = 0x0020
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
"C:\Program Files (x86)\AutoIt3\Include\Services.au3"(94,46) : 错误: $SERVICE_PAUSE_CONTINUE 变量先前已声明为非常量.
Global Const $SERVICE_PAUSE_CONTINUE = 0x0040
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
"C:\Program Files (x86)\AutoIt3\Include\Services.au3"(95,43) : 错误: $SERVICE_INTERROGATE 变量先前已声明为非常量.
Global Const $SERVICE_INTERROGATE = 0x0080
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
"C:\Program Files (x86)\AutoIt3\Include\Services.au3"(96,52) : 错误: $SERVICE_USER_DEFINED_CONTROL 变量先前已声明为非常量.
Global Const $SERVICE_USER_DEFINED_CONTROL = 0x0100
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
"C:\Program Files (x86)\AutoIt3\Include\Services.au3"(98,43) : 错误: $SERVICE_ALL_ACCESS 变量先前已声明为非常量.
Global Const $SERVICE_ALL_ACCESS = 0xF01FF
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
"C:\Program Files (x86)\AutoIt3\Include\Services.au3"(111,48) : 错误: $SERVICE_CONTROL_STOP 变量先前已声明为非常量.
Global Const $SERVICE_CONTROL_STOP = 0x00000001
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
"C:\Program Files (x86)\AutoIt3\Include\Services.au3"(112,49) : 错误: $SERVICE_CONTROL_PAUSE 变量先前已声明为非常量.
Global Const $SERVICE_CONTROL_PAUSE = 0x00000002
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
"C:\Program Files (x86)\AutoIt3\Include\Services.au3"(113,52) : 错误: $SERVICE_CONTROL_CONTINUE 变量先前已声明为非常量.
Global Const $SERVICE_CONTROL_CONTINUE = 0x00000003
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
"C:\Program Files (x86)\AutoIt3\Include\Services.au3"(114,55) : 错误: $SERVICE_CONTROL_INTERROGATE 变量先前已声明为非常量.
Global Const $SERVICE_CONTROL_INTERROGATE = 0x00000004
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
"C:\Program Files (x86)\AutoIt3\Include\Services.au3"(115,52) : 错误: $SERVICE_CONTROL_SHUTDOWN 变量先前已声明为非常量.
Global Const $SERVICE_CONTROL_SHUTDOWN = 0x00000005
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
"C:\Program Files (x86)\AutoIt3\Include\Services.au3"(116,55) : 错误: $SERVICE_CONTROL_PARAMCHANGE 变量先前已声明为非常量.
Global Const $SERVICE_CONTROL_PARAMCHANGE = 0x00000006
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
"C:\Program Files (x86)\AutoIt3\Include\Services.au3"(117,54) : 错误: $SERVICE_CONTROL_NETBINDADD 变量先前已声明为非常量.
Global Const $SERVICE_CONTROL_NETBINDADD = 0x00000007
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
"C:\Program Files (x86)\AutoIt3\Include\Services.au3"(118,57) : 错误: $SERVICE_CONTROL_NETBINDREMOVE 变量先前已声明为非常量.
Global Const $SERVICE_CONTROL_NETBINDREMOVE = 0x00000008
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
"C:\Program Files (x86)\AutoIt3\Include\Services.au3"(119,57) : 错误: $SERVICE_CONTROL_NETBINDENABLE 变量先前已声明为非常量.
Global Const $SERVICE_CONTROL_NETBINDENABLE = 0x00000009
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
"C:\Program Files (x86)\AutoIt3\Include\Services.au3"(120,58) : 错误: $SERVICE_CONTROL_NETBINDDISABLE 变量先前已声明为非常量.
Global Const $SERVICE_CONTROL_NETBINDDISABLE = 0x0000000A
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
"C:\Program Files (x86)\AutoIt3\Include\Services.au3"(121,55) : 错误: $SERVICE_CONTROL_DEVICEEVENT 变量先前已声明为非常量.
Global Const $SERVICE_CONTROL_DEVICEEVENT = 0x0000000B
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
"C:\Program Files (x86)\AutoIt3\Include\Services.au3"(122,65) : 错误: $SERVICE_CONTROL_HARDWAREPROFILECHANGE 变量先前已声明为非常量.
Global Const $SERVICE_CONTROL_HARDWAREPROFILECHANGE = 0x0000000C
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
"C:\Program Files (x86)\AutoIt3\Include\Services.au3"(123,54) : 错误: $SERVICE_CONTROL_POWEREVENT 变量先前已声明为非常量.
Global Const $SERVICE_CONTROL_POWEREVENT = 0x0000000D
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
"C:\Program Files (x86)\AutoIt3\Include\Services.au3"(124,57) : 错误: $SERVICE_CONTROL_SESSIONCHANGE 变量先前已声明为非常量.
Global Const $SERVICE_CONTROL_SESSIONCHANGE = 0x0000000E
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
"C:\Program Files (x86)\AutoIt3\Include\Services.au3"(132,49) : 错误: $SERVICE_KERNEL_DRIVER 变量先前已声明为非常量.
Global Const $SERVICE_KERNEL_DRIVER = 0x00000001
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
"C:\Program Files (x86)\AutoIt3\Include\Services.au3"(133,54) : 错误: $SERVICE_FILE_SYSTEM_DRIVER 变量先前已声明为非常量.
Global Const $SERVICE_FILE_SYSTEM_DRIVER = 0x00000002
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
"C:\Program Files (x86)\AutoIt3\Include\Services.au3"(134,43) : 错误: $SERVICE_ADAPTER 变量先前已声明为非常量.
Global Const $SERVICE_ADAPTER = 0x00000004
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
"C:\Program Files (x86)\AutoIt3\Include\Services.au3"(135,53) : 错误: $SERVICE_RECOGNIZER_DRIVER previously defined as a non-'Const' var.
Global Const $SERVICE_RECOGNIZER_DRIVER = 0x00000008
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
"C:\Program Files (x86)\AutoIt3\Include\Services.au3"(138,36) : 错误: $SERVICE_DRIVER 变量先前已声明为非常量.
                                                        $SERVICE_RECOGNIZER_DRIVER )
                                                        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
"C:\Program Files (x86)\AutoIt3\Include\Services.au3"(139,53) : 错误: $SERVICE_WIN32_OWN_PROCESS 变量先前已声明为非常量.
Global Const $SERVICE_WIN32_OWN_PROCESS = 0x00000010
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
"C:\Program Files (x86)\AutoIt3\Include\Services.au3"(140,55) : 错误: $SERVICE_WIN32_SHARE_PROCESS 变量先前已声明为非常量.
Global Const $SERVICE_WIN32_SHARE_PROCESS = 0x00000020
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
"C:\Program Files (x86)\AutoIt3\Include\Services.au3"(142,38) : 错误: $SERVICE_WIN32 变量先前已声明为非常量.
                                                        $SERVICE_WIN32_SHARE_PROCESS )
                                                        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
"C:\Program Files (x86)\AutoIt3\Include\Services.au3"(143,55) : 错误: $SERVICE_INTERACTIVE_PROCESS 变量先前已声明为非常量.
Global Const $SERVICE_INTERACTIVE_PROCESS = 0x00000100
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
"C:\Program Files (x86)\AutoIt3\Include\Services.au3"(147,39) : 错误: $SERVICE_TYPE_ALL 变量先前已声明为非常量.
                                                                $SERVICE_INTERACTIVE_PROCESS )
                                                                ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
"C:\Program Files (x86)\AutoIt3\Include\Services.au3"(151,48) : 错误: $SERVICE_SYSTEM_START 变量先前已声明为非常量.
Global Const $SERVICE_SYSTEM_START = 0x00000001
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
"C:\Program Files (x86)\AutoIt3\Include\Services.au3"(152,46) : 错误: $SERVICE_AUTO_START 变量先前已声明为非常量.
Global Const $SERVICE_AUTO_START = 0x00000002
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
"C:\Program Files (x86)\AutoIt3\Include\Services.au3"(153,48) : 错误: $SERVICE_DEMAND_START 变量先前已声明为非常量.
Global Const $SERVICE_DEMAND_START = 0x00000003
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
"C:\Program Files (x86)\AutoIt3\Include\Services.au3"(154,44) : 错误: $SERVICE_DISABLED 变量先前已声明为非常量.
Global Const $SERVICE_DISABLED = 0x00000004
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
"C:\Program Files (x86)\AutoIt3\Include\Services.au3"(157,48) : 错误: $SERVICE_ERROR_IGNORE 变量先前已声明为非常量.
Global Const $SERVICE_ERROR_IGNORE = 0x00000000
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
"C:\Program Files (x86)\AutoIt3\Include\Services.au3"(158,48) : 错误: $SERVICE_ERROR_NORMAL 变量先前已声明为非常量.
Global Const $SERVICE_ERROR_NORMAL = 0x00000001
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
"C:\Program Files (x86)\AutoIt3\Include\Services.au3"(159,48) : 错误: $SERVICE_ERROR_SEVERE 变量先前已声明为非常量.
Global Const $SERVICE_ERROR_SEVERE = 0x00000002
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
"C:\Program Files (x86)\AutoIt3\Include\Services.au3"(160,50) : 错误: $SERVICE_ERROR_CRITICAL 变量先前已声明为非常量.
Global Const $SERVICE_ERROR_CRITICAL = 0x00000003
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
C:\Users\lwk\Desktop\serice.au3 - 49 条错误, 0 条警告
!>15:48:18 AU3Check 语法检查结束. 点击 F4 键跳转到下一个可能的错误.rc:2
+>15:48:18 AutoIt3Wrapper 完成脚本处理.
>Exit code: 2    Time: 1.06

可能是 autoit 版本问题..........

TOP

可能是 autoit 版本问题..........
131738 发表于 2018-1-13 11:09


也许是吧?
我搜遍了论坛,只能搜集到这两个版本,试过都不行。。。
实在搞不懂了。。。
UDF的分支太多了?  支持那么分裂的么。。。。晕。。。

TOP

返回列表