|
ThisWorkbook.Activate
For m = 1 To FileCount
FileName = Application.FileDialog(msoFileDialogOpen).SelectedItems(m)
FileIndex = Mid(FileName, InStrRev(FileName, "\") + 1, InStrRev(FileName, ".") - InStrRev(FileName, "\") - 1)
Set f = fso.getfile(FileName)
DoEvents
Set s = f.OpenAsTextStream(ForReading)
bstart = False
Do While Not s.AtEndOfStream
ReadText = s.ReadLine()
If Left(ReadText, 2) = "%%" Then
Script = Mid(ReadText, 3, Len(ReadText) - 4)
ReadText = s.ReadLine()
If InStr(ReadText, "成功") Then
info = "执行成功"
Else
'ReadText = s.ReadLine()
'Do While ReadText = ""
'ReadText = s.ReadLine()
'Loop
info = ReadText
End If
wsTemp.Cells(l, 1) = FileIndex
wsTemp.Cells(l, 2) = info
wsTemp.Cells(l, 3) = Script
l = l + 1
End If
Loop
s.Close
|
|