'Created by Krzysztof Sieluzycki 'On Error Resume Next printerName = "Wydruk Centralny" hostsPath="hosts.txt" Set fsObj = CreateObject("Scripting.FileSystemObject") Set hosts = fsObj.OpenTextFile(hostsPath,1) Do while NOT hosts.AtEndOfStream host = hosts.ReadLine Set objWMIService = Nothing Set objWMIService = GetObject("winmgmts:\\" & host & "\root\cimv2") Wscript.Echo "Host " & host If objWMIService is Nothing Then Wscript.Echo " did not respond" Else Set os = objWMIService.ExecQuery("Select * From Win32_OperatingSystem") For Each o in os Wscript.Echo o.version & "(" & o.Caption & ")" Next Set printers = objWMIService.ExecQuery("Select * From Win32_Printer") found = false For Each printer in printers If InStr(printer.Name,printerName) > 0 Then found=true End If Next If found = True Then Wscript.echo "Has a queue named: " & printerName Else Wscript.Echo "Does not have a queue named: " & printerName End If End If Loop