Hello,
I am new to scripting. I've come up with a script that works only if i put
the variable
strComputer = "."
However when I create an input text file and an output textfile it works
partially.
Here is the script:
Set fso = CreateObject("Scripting.FileSystemObject")
Set objInputFile = fso.OpenTextFile("d:\Computers.txt", 1, True)
Set objOutputFile = fso.OpenTextFile("d:\Results.txt", 2, True)
Do While objInputFile.AtEndOfLine <> True
strComputer = objInputFile.ReadLine
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set colQuickFixes = objWMIService.ExecQuery _
("Select * from Win32_QuickFixEngineering")
For Each objQuickFix in colQuickFixes
objOutputFile.Writeline "Computer: " & objQuickFix.CSName
objOutputFile.Writeline "Description: " & objQuickFix.Description
objOutputFile.Writeline "Hot Fix ID: " & objQuickFix.HotFixID
objOutputFile.Writeline "Installation Date: " & objQuickFix.InstallDate
objOutputFile.Writeline "Installed By: " & objQuickFix.InstalledBy
objOutputFile.Writeline
Next
Loop
I am running the script locally on my machine and in the Computers.txt file
is under the format "computer name" ex comp001, on line 2 it is comp002
etc....
Once i run the script it finds the 1st comp line and writes the results to
the results.txt file and then it stops with the error:
D:\_SCRIPTS\_VBSEDIT SCRIPTS\Computer Updates and SP.vbs(8, 2) (null):
0x80041021
How can i correct the above script?
Tacobell2000