#NoTrayIcon
Opt("MustDeclareVars", 1)
#include <Constants.au3>
Local $Drive, $I, $File
$File = InputBox("输入", "输入要查找的文件名:", "", "", 180, 80, -1, -1)
If @error Or $File = "" Then Exit
$Drive = DriveGetDrive("FIXED")
For $I = 1 To $Drive[0]
Local $foo, $line, $lines
$foo = Run(@ComSpec & " /c dir /b /s /a " & $File, $Drive[$I] & "\", @SW_HIDE, $STDOUT_CHILD)
$lines = ""
While 1
$line = StdoutRead($foo)
If @error Then ExitLoop
$lines &= $line
WEnd
If $lines = "" Then
MsgBox(16, "错误", "在驱动器" & $Drive[$I] & "没有找到要找的文件!", 2)
ContinueLoop 1
EndIf
MsgBox(0, "找到的文件:", $lines)
Next
|