Searching a huge number of strings from Excel to a large number of Text files
A few suggestions:


Most obvious (and simple) step is to read the entire file, and not one line at the time

Change this:

Set file = fso.OpenTextFile(Path)
Do While Not file.AtEndOfLine
    Line = file.ReadLine
    If InStr(1, Line, theString, vbTextCompare) &gt; 0 Then
        ws2.Cells(K, 4).Value = Str
        ws2.Cells(K, 5).Value = fname
        ws2.Cells(K, 6).Value = "Srting is found"
        flag = "Y"
    End If
Loop


To this:

Set file = fso.OpenTextFile(Path)

fullFile = file.ReadAll

If InStr(1, fullFile, theString, vbTextCompare) &gt; 0 Then
    With ws2
        .Cells(K, 4).Value2 = theString
        .Cells(K, 5).Value2 = fname
    End With
    flag = "Y"
End If


It eliminates the do-while loop. More details about .ReadAll().
Store Str and fname info into an array, then commit the entire array to the worksheet at the end, instead of writing to each cell separately.
The "Find" command in DOS might be faster and it can also provide the line number(s) where the string is found:

Find /?

Searches for a text string in a file or files.

FIND [/V] [/C] [/N] [/I] [/OFF[LINE]] "string" [[drive:][path]filename[ ...]]