Search the Community
Showing results for tags 'printjob'.
Found 2 results
I'm writing code to manage print jobs. The on-line searches I did showed different ways of calling a print job method. I see these ways of calling print job methods: $oPrintjob.Delete_ (Method name followed by underline) $oPrintJob.Resume() (Method name followed by open/closed parens) $oPrintJob.Status (Method name followed by nothing at all)I don't understand syntax where the method name is followed by an underline. When is it correct to use the method name followed by an underline vs the open/closed parens vs nothing at all?
I'm trying to display information from my printer queues and I cannot figure how to convert the 'datetime' value returned in the "time submitted" item to a date and time. Here's my test code: test3() Func test3() Local $str, $objWMIService, $AllPrintJobs, $PrintJob While 1 $objWMIService = ObjGet("winmgmts:\\" & @ComputerName & "\root\CIMV2") $AllPrintJobs = $objWMIService.ExecQuery("SELECT * FROM Win32_PrintJob") For $PrintJob In $AllPrintJobs $str = "" $str &= "Name: " & $PrintJob.Name & @CRLF ; Name of the printer $str &= "DocName " & $PrintJob.Document & @CRLF; Documentname $str &= "HostName: " & $PrintJob.HostPrintQueue & @CRLF ; Computer where the Printjob started from ; Time the printjob was submitted $str &= "Time Submitted: " & $PrintJob.TimeSubmitted & @CRLF $str &= @CRLF ConsoleWrite($str & @CRLF) Exit ;;; TESTING ;;; Next Sleep(1000) ;Log every second WEnd EndFunc ;==>test3 The Console output looks like this: Name: HP LaserJet Professional P 1102w, 2 DocName Test Page HostName: \\ANDY-LAPTOP2 Time Submitted: 20150624161307.544000-240How can I convert the "20150624161307.544000-240" value to a date and time?