Dim fso
Dim str
str = "我爱你" '这里定义你要找的字符串
Set fso = WScript.CreateObject("Scripting.Filesystemobject")
Set read = fso.OpenTextFile("d:\workNote.txt",1)'其内路径是你要从哪里找的那个文本
temp = read.ReadAll
If InStr(temp, str)>0 Then
WScript.Echo "find"
Set output = fso.CreateTextFile("d:\workNote1.txt",True) '这个路径是你想要把你搜的字符串写到哪
output.Write str
WScript.Echo "写成功,保存完毕!"
output.Close
Else
MsgBox "not found"
End If
Set fso = nothing