找回密码
 加入
搜索
查看: 1417|回复: 2

RUN能设定运行时间咩?

[复制链接]
发表于 2008-8-7 14:36:19 | 显示全部楼层 |阅读模式
RUN能设定运行时间咩?
我想用AU3调用“D:\检查”里的全部EXE。脚本如下:

$FilePath = "D:\检查"
$searchFile = FileFindFirstFile($FilePath & "\*.exe")
If $searchFile = -1 Then
    MsgBox(0, "错误", "无任何文件或文件夹与指定的搜索字符串匹配")
    Exit
EndIf

While 1
    $file = FileFindNextFile($searchFile)
    If @error Then ExitLoop
    RunWait($FilePath & "\" & $file,$FilePath)
WEnd

FileClose($searchFile)

在运行过程中有一些exe因配置不全而无法顺利结束,导致下一个程序无法开始,请问一下能不能加点什么使用每个exe最多运行5分钟?

[ 本帖最后由 douyuan 于 2008-8-7 20:24 编辑 ]
发表于 2008-8-7 16:31:01 | 显示全部楼层
$FilePath = "D:\检查"
$searchFile = FileFindFirstFile($FilePath & "\*.exe")
If $searchFile = -1 Then
    MsgBox(0, "错误", "无任何文件或文件夹与指定的搜索字符串匹配")
    Exit
EndIf

While 1
    $file = FileFindNextFile($searchFile) 
    If @error Then ExitLoop
        Run($FilePath & "\" & $file,$FilePath)
        $T0=TimerInit ()
        While ProcessExists($file)
                $T1=TimerDiff ( $T0 )
                If  $T1>5000*60 Then
                        ProcessClose($file)
                        ExitLoop
                EndIf
                Sleep(100)
        WEnd
WEnd
FileClose($searchFile)


[ 本帖最后由 顽固不化 于 2008-8-7 16:34 编辑 ]
发表于 2013-3-20 09:23:16 | 显示全部楼层
好东西,学习了,谢谢分享
您需要登录后才可以回帖 登录 | 加入

本版积分规则

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

GMT+8, 2024-9-29 09:37 , Processed in 0.075970 second(s), 20 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

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