Here is my issue.
I can read from the file:
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objReadFile = objFSO.OpenTextFile("C:\anyname.txt", ForReading)
strComputer = objReadFile.ReadLine
Set objTextFile = objFSO.OpenTextFile("Cath\"&strComputer&".htm", ForWriting, True)
Do While objReadFile.AtEndOfStream = False
strComputer = objReadFile.ReadLine
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
Set colItems = objWMIService.ExecQuery("Select * from Win32_Service",,48)
wscript.echo objItem.SystemName
Loop
Here is the issue:
If I take out the first strComputer = bjReadFile.ReadLine the script works fine. If however I do use that first strComputer = objReadFile.ReadLine, the whole script produces nothing.
How can I use the read computer name to create a file with that name and use that computer name in my queries?
I can read from the file:
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objReadFile = objFSO.OpenTextFile("C:\anyname.txt", ForReading)
strComputer = objReadFile.ReadLine
Set objTextFile = objFSO.OpenTextFile("Cath\"&strComputer&".htm", ForWriting, True)
Do While objReadFile.AtEndOfStream = False
strComputer = objReadFile.ReadLine
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
Set colItems = objWMIService.ExecQuery("Select * from Win32_Service",,48)
wscript.echo objItem.SystemName
Loop
Here is the issue:
If I take out the first strComputer = bjReadFile.ReadLine the script works fine. If however I do use that first strComputer = objReadFile.ReadLine, the whole script produces nothing.
How can I use the read computer name to create a file with that name and use that computer name in my queries?