I have save all your code in file vbs and run it. Program run and print each line on each window and don't create output file.
Set objFS=CreateObject("Scripting.FileSystemObject")
strFolder = "G:\AH\aa"
Set objFolder = objFS.GetFolder(strFolder)
Go (objFolder)
Sub Go(objDIR)
If objDIR <> "\System Volume Information" Then
For Each eFolder in objDIR.SubFolders
Go eFolder
Next
End If
For Each strFile In objDIR.Files
name =strFile.Name
If objFS.GetExtensionName(strFile) = "txt" Then
Set objFile = objFS.OpenTextFile(name)
Do Until objFile.AtEndOfStream
strLine = objFile.ReadLine
WScript.Echo Mid(strLine,1,10)
Loop
Set objFile = Nothing
End If
Next
End Sub
"G:\AH\aa" it my path and folder "aa" have many file txt.
My "Scripting Host" error?