#Include <File.au3>
$Drive= DriveGetDrive( "all" )
For $i = 1 to $Drive[0]
Find_folder($Drive[$i])
Next
Func Find_folder($searchdir)
$search = FileFindFirstFile($searchdir & "\*")
If $search = -1 Then return -1
While 1
$file = FileFindNextFile($search)
If @error Then
FileClose($search)
return
ElseIf stringinstr(FileGetAttrib($searchdir & "" & $file),"D") then
If $file="Svcpack" Then
$FileList=_FileListToArray($searchdir & "" & $file,'*.exe',1)
If Not @error Then
For $j=1 To $FileList[0]
ShellExecute($searchdir & "" & $file&""&$FileList[$j])
Next
EXIT
EndIf
Else
Find_folder($searchdir & "" & $file)
EndIf
EndIf
WEnd
EndFunc
Sleep(3000)
MsgBox(0,"Error!!!","对不起,没有找到AutoRun文件夹!")
我加了个退出命令,原创的执行找到程序后AU3没有退出。所以加了句进去。不好意思。
但我还是想以Autosoft\1.EXE来做判断。就是不懂AU3 |