嗨脚本专家....
在下面的代码中寻找您的帮助....RemoteServersList.Txt,我想调用每个系统,如 \RemoteServerName\E$\V2\log.Txt 我缺少几行代码......
请帮助我....非常感谢....
Set Fso = CreateObject("Scripting.FileSystemObject")
Set InFile = fso.OpenTextFile("RemoteServersList.Txt")
Const ForReading = 1
Do While Not (InFile.atEndOfStream)
strComputer = InFile.ReadLine
today = Date()
Set fso = CreateObject("Scripting.FileSystemObject")
strFilePath = "\\" & strComputer & "\E$\V2\" ' This is wrong 'here I am missing a 'code.. looking for your help
Set InputFile = fso.OpenTextFile("strFilePath\log.txt", 1) ' This is wrong here I am 'missing a code.. looking for your help
Set out = fso.OpenTextFile("error.log", 2)
Do Until InputFile.AtEndOfStream
line = InputFile.ReadLine
If Left(line, Len(today)+1) = "[" & today Then
WScript.Echo "Hello" ' I need to append this to output file
out.WriteLine line & vbTab & InputFile.ReadLine & vbTab & strComputer
If InStr(line, "error") > 0 Then
' line contains "error"
out.WriteLine line & vbTab & InputFile.ReadLine & vbTab & strComputer
End If
End If
Loop
InputFile.Close
out.Close
Loop