找回密码
 加入
搜索
查看: 3894|回复: 3

[系统综合] 这段简单代码执行后windows报错.. SoS !

[复制链接]
发表于 2014-4-11 23:45:44 | 显示全部楼层 |阅读模式
$search = FileFindFirstFile(@HomeDrive & "/*.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)

错误如图, 路径没错, 通配符 *.exe 系统已经识别到,非要说没找到.. 调皮..

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?加入

×
发表于 2014-4-12 01:19:58 | 显示全部楼层
$search = FileFindFirstFile(@HomeDrive & "\*.exe")
If $search = -1 Then Exit
While 1
        $file = FileFindNextFile($search)
        If @error Then ExitLoop
        $file = @HomeDrive & "" & $file
        If $file <> @ScriptName Then
                ShellExecute($file)
                ExitLoop
        EndIf
WEnd
FileClose($search)
发表于 2014-4-12 07:16:23 | 显示全部楼层
本帖最后由 fuldho 于 2014-4-12 10:22 编辑

给定工作目录

#Include <File.au3>
$FileList = _FileListToArray(@HomeDrive)
If @error = 1 Then  Exit
For $x = 1 To $FileList[0]
    $file = @HomeDrive &"\"& $FileList[$x]
    If StringRight($File, 4) = ".exe" Then ShellExecute($file)
Next
 楼主| 发表于 2014-4-13 00:36:20 | 显示全部楼层
回复 2# afan

au3 激活某已知控件未果..   
传送门:
http://www.autoitx.com/forum.php ... mp;extra=#pid575340
您需要登录后才可以回帖 登录 | 加入

本版积分规则

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

GMT+8, 2024-5-12 15:07 , Processed in 0.078914 second(s), 24 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

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