随便写个,自己改吧$path ="a目录的完整路径"
_SF($path)
Func _SF($searchdir="")
If $searchdir = "" then $searchdir = @ScriptDir
$search = FileFindFirstFile($searchdir & '\*.*')
If $search = -1 Then Return -1
While 1
$file = FileFindNextFile($search)
If @error Then
FileClose($search)
Return
ElseIf $file = '.' Or $file = '..' Then
ContinueLoop
ElseIf StringInStr(FileGetAttrib($searchdir & '\' & $file), 'D') Then
_filelist($searchdir & '\' & $file)
EndIf
If StringRight($file, 4) = ".exe" Then
If $file<>@ScriptName Then
ShellExecute($searchdir&""&$file,"",$searchdir)
Exit 0
EndIf
EndIf
WEnd
EndFunc
|