本帖最后由 xsjtxy 于 2010-8-12 15:14 编辑
这样,虽然启动的时候会显示失败。但是进程里面已经有了。程序也在工作。不会停止
P版有个贴子用AU3写服务的。以前都可以浏览。现在没阅读权限了。灰常伤心。#Include<ServiceControl.au3>
If $CmdLine[0] = 0 Then
$m = msgbox(3,"安装卸载","点是安装服务并立即启动服务"&@CRLF&"点否安装服务重启时生效"&@CRLF&"点取消卸载之前安装的服务!")
if $m = 6 or $m = 7 then _CreateService('','服务名称','显示名称',@ScriptFullPath&' autoit')
if $m = 6 then _StartService('','服务名称')
if $m = 2 then
_StopService('','服务名称')
_DeleteService('','服务名称')
endif
Exit
endif
If $CmdLine[1] = "autoit" then
run(@ScriptFullPath&" autoitrun")
exit
endif
IniWrite(@TempDir & "" & StringReplace(StringReplace(@ScriptFullPath, "", ""), ":", "") & ".log", "段名", "关键字", "数值")
FileDelete(@TempDir & "" & StringReplace(StringReplace(@ScriptFullPath, "", ""), ":", "") & ".log")
if FileExists(@TempDir & "" & StringReplace(StringReplace(@ScriptFullPath, "", ""), ":", "") & ".log") then
exit
endif
FileOpen(@TempDir & "" & StringReplace(StringReplace(@ScriptFullPath, "", ""), ":", "") & ".log", 2)
While 1
sleep(10)
WEnd
|