; Generated by AutoIt Scriptomatic $wbemFlagReturnImmediately = 0x10 $wbemFlagForwardOnly = 0x20 $colItems = "" $strComputer = "localhost" $Output="" $Output &= "Computer: " & $strComputer & @CRLF $Output &= "==========================================" & @CRLF $objWMIService = ObjGet("winmgmts:\\" & $strComputer & "\root\CIMV2") $colItems = $objWMIService.ExecQuery("SELECT * FROM Win32_PrintJob", "WQL", $wbemFlagReturnImmediately + $wbemFlagForwardOnly) If IsObj($colItems) then For $objItem In $colItems $Output &= "Caption: " & $objItem.Caption & @CRLF $Output &= "DataType: " & $objItem.DataType & @CRLF $Output &= "Description: " & $objItem.Description & @CRLF $Output &= "Document: " & $objItem.Document & @CRLF $Output &= "DriverName: " & $objItem.DriverName & @CRLF $Output &= "ElapsedTime: " & WMIDateStringToDate($objItem.ElapsedTime) & @CRLF $Output &= "HostPrintQueue: " & $objItem.HostPrintQueue & @CRLF $Output &= "InstallDate: " & WMIDateStringToDate($objItem.InstallDate) & @CRLF $Output &= "JobId: " & $objItem.JobId & @CRLF $Output &= "JobStatus: " & $objItem.JobStatus & @CRLF $Output &= "Name: " & $objItem.Name & @CRLF $Output &= "Notify: " & $objItem.Notify & @CRLF $Output &= "Owner: " & $objItem.Owner & @CRLF $Output &= "PagesPrinted: " & $objItem.PagesPrinted & @CRLF $Output &= "Parameters: " & $objItem.Parameters & @CRLF $Output &= "PrintProcessor: " & $objItem.PrintProcessor & @CRLF $Output &= "Priority: " & $objItem.Priority & @CRLF $Output &= "Size: " & $objItem.Size & @CRLF $Output &= "StartTime: " & WMIDateStringToDate($objItem.StartTime) & @CRLF $Output &= "Status: " & $objItem.Status & @CRLF $Output &= "StatusMask: " & $objItem.StatusMask & @CRLF $Output &= "TimeSubmitted: " & WMIDateStringToDate($objItem.TimeSubmitted) & @CRLF $Output &= "TotalPages: " & $objItem.TotalPages & @CRLF $Output &= "UntilTime: " & WMIDateStringToDate($objItem.UntilTime) & @CRLF ;if Msgbox(1,"WMI Output",$Output) = 2 then ExitLoop ConsoleWrite($Output & @CRLF) $Output="" Next Else Msgbox(0,"WMI Output","No WMI Objects Found for class: " & "Win32_PrintJob" ) Endif Func WMIDateStringToDate($dtmDate) Return (StringMid($dtmDate, 5, 2) & "/" & _ StringMid($dtmDate, 7, 2) & "/" & StringLeft($dtmDate, 4) _ & " " & StringMid($dtmDate, 9, 2) & ":" & StringMid($dtmDate, 11, 2) & ":" & StringMid($dtmDate,13, 2)) EndFunc