找回密码
 加入
搜索
查看: 3686|回复: 7

[AU3基础] .. 这 无限打开指定的程序...哪错了 ?我只想运行一个exe

  [复制链接]
发表于 2014-3-9 20:31:27 | 显示全部楼层 |阅读模式
本帖最后由 yuan278501381 于 2014-3-9 20:36 编辑

$search = FileFindFirstFile("*.exe")
If $search = -1 Then Exit
While 1
    $file = FileFindNextFile($search)
    If @error Then ExitLoop
    ShellExecute ($file)
发表于 2014-3-9 20:51:14 | 显示全部楼层
光这一段不会导致重复运行某个exe程序。
 楼主| 发表于 2014-3-9 21:53:08 | 显示全部楼层
回复 2# afan


$search = FileFindFirstFile("*.exe")
If $search = -1 Then Exit
While 1
    $file = FileFindNextFile($search)
    If @error Then ExitLoop
    ShellExecute ($file)
WEnd
FileClose($search)

TrayTip("请勿移动鼠标和敲击键盘!!","正在开始...",2900)
后面就是 WinWait() 之类的
发表于 2014-3-9 22:02:50 | 显示全部楼层
回复  afan


$search = FileFindFirstFile("*.exe")
If $search = -1 Then Exit
While 1
    $file ...
yuan278501381 发表于 2014-3-9 21:53



    一样的,这样不会“重复运行某个exe程序”。
如果你说的“只想运行一个exe”是指只运行某个程序那你这段就是错误的,因为你是用的“*.exe”
 楼主| 发表于 2014-3-9 22:35:04 | 显示全部楼层
回复 4# afan
找到问题所在了.. 我把编译后的exe文件放到了同一个目录,,,,     那我这中情况要怎么改才行啊 需要执行的*.exe文件名不确定的
发表于 2014-3-10 00:59:29 | 显示全部楼层
回复  afan
找到问题所在了.. 我把编译后的exe文件放到了同一个目录,,,,     那我这中情况要怎么改才行啊 ...
yuan278501381 发表于 2014-3-9 22:35
$search = FileFindFirstFile("*.exe")
If $search = -1 Then Exit
While 1
        $file = FileFindNextFile($search)
        If @error Then ExitLoop
        If $file <> @ScriptName Then
                ShellExecute($file)
                ExitLoop
        EndIf
WEnd
FileClose($search)
 楼主| 发表于 2014-3-14 19:18:48 | 显示全部楼层
回复 6# afan

谢谢  你回答的风格很niubility
 楼主| 发表于 2014-4-12 00:11:47 | 显示全部楼层
回复 6# afan
我现在用这段代码  windows 报错..
如下
http://autoitx.com/forum.php?mod ... 4028&highlight=
您需要登录后才可以回帖 登录 | 加入

本版积分规则

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

GMT+8, 2024-5-18 15:52 , Processed in 0.076089 second(s), 24 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

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