这段简单代码执行后windows报错.. SoS !
$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 系统已经识别到,非要说没找到.. 调皮..
$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) 本帖最后由 fuldho 于 2014-4-12 10:22 编辑
给定工作目录
#Include <File.au3>
$FileList = _FileListToArray(@HomeDrive)
If @error = 1 ThenExit
For $x = 1 To $FileList
$file = @HomeDrive &"\"& $FileList[$x]
If StringRight($File, 4) = ".exe" Then ShellExecute($file)
Next 回复 2# afan
au3 激活某已知控件未果.. {:face (427):}
传送门:
http://www.autoitx.com/forum.php?mod=viewthread&tid=44037&page=1&extra=#pid575340
页:
[1]