WMI sample: lists the printjobs on a printserver. Written in VBScript. Uses Win32_PrintJob WMI clas
WMI sample: lists the printjobs on a printserver. Written in VBScript. Uses Win32_PrintJob WMI class.
Rate WMI sample: lists the printjobs on a printserver. Written in VBScript. Uses Win32_PrintJob WMI clas
(3(3 Vote))
' This function lists the printjobs on a printserver
' Check out http://www.activexperts.com for more samples and components
Sub ListobjPrintJobs( strPrintServer )
Dim strObject, objPrintJobSet
strObject = "winmgmts://" & strPrintServer
Set objPrintJobSet = GetObject( strObject ).InstancesOf( "Win32_PrintJob" )
If( objPrintJobSet.Count = 0 ) Then
WScript.Echo "No print jobs!"
End If
For Each objPrintJob in objPrintJobSet
WScript.Echo objPrintJob.Name
WScript.Echo objPrintJob.JobId
WScript.Echo objPrintJob.Status
WScript.Echo objPrintJob.TotalPages
Wscript.Echo ""
Next
End Sub
' Main
Dim strPrintServer
Do
strPrintServer = inputbox( "Please enter the name of the printserver (plain name, no UNC format)", "Input" )
Loop until strPrintServer <> ""
ListobjPrintJobs( strPrintServer )
WScript.Echo( "Check out http://www.activexperts.com for more samples and components" )
WMI sample: lists the printjobs on a printserver. Written in VBScript. Uses Win32_PrintJob WMI clas Comments
No comments yet — be the first to post one!
Post a Comment