Код:

Option Explicit
Dim strMachineList
Dim strComputer
Dim objSWbemLocator
Dim objSWbemObjectEx
If WScript.Arguments.Count = 1 Then
strMachineList = WScript.Arguments.Item(0)
With WScript.CreateObject("Scripting.FileSystemObject")
If .FileExists(strMachineList) Then
Set objSWbemLocator = WScript.CreateObject("WbemScripting.SWbemLocator")
With .OpenTextFile(strMachineList)
Do Until .AtEndOfStream
strComputer = Trim(.ReadLine())
If IsConnected(strComputer) Then
For Each objSWbemObjectEx In objSWbemLocator.ConnectServer(strComputer, "root\cimv2").ExecQuery("SELECT * FROM Win32_ComputerSystem")
WScript.Echo objSWbemObjectEx.Name, vbTab, objSWbemObjectEx.TotalPhysicalMemory
Next
Else
WScript.Echo strComputer & " not found."
End If
Loop
.Close
End With
Set objSWbemLocator = Nothing
Else
WScript.Echo "Machine list file [" & strMachineList & "] not found."
WScript.Quit 2
End If
End With
Else
WScript.Echo "Usage: cscript.exe //nologo """ & WScript.ScriptName & """ <Machine list file>"
WScript.Quit 1
End If
WScript.Quit 0
'=============================================================================
'=============================================================================
Function IsConnected(strAddress)
Dim objSWbemObjectEx
IsConnected = False
For Each objSWbemObjectEx In GetObject( _
"winmgmts:{impersonationLevel=impersonate}!\\.\root\cimv2").ExecQuery( _
"SELECT * FROM Win32_PingStatus WHERE Address = '" & strAddress & "'" _
)
With objSWbemObjectEx
If Not IsNull(.StatusCode) And .StatusCode = 0 Then
IsConnected = True
End If
End With
Exit For
Next
Set objSWbemObjectEx = Nothing
End Function
'=============================================================================