WMI Libraly > Win32_PrintJob Class

来源:互联网 发布:网络视听节目 编辑:程序博客网 时间:2024/06/08 17:39
WMI Libraly > Win32_PrintJob Class

Win32_PrintJob Class

CIM_Job is a logical element representing a unit of work for a system, such as a print job. A job is distinct from a process in that a job can be scheduled. 
Namespace value is root/CIMV2.
WMI Provider value is CIMWin32.


Properties

  • CaptionThe Caption property is a short textual description (one-line string) of the object.

  • ColorThe Color property indicates whether the document is to be printed in color or monochrome. Some color printers have the capability to print using true black instead of a combination of Yellow, Cyan, and Magenta. This usually creates darker and sharper text for documents. This option is only useful for color printers that support true black printing.

  • DataTypeThe DataType property indicates the format of the data for this print job. This instructs the printer driver to eithertranslate the data (generic text, PostScript, or PCL) before printing, or to print in a raw format (for graphics and pictures).
    Example: TEXT

  • DescriptionThe Description property provides a textual description of the object. 

  • DocumentThe Document property specifies the name of the print job. The user sees this name when viewing documents waiting to be printed. 
    Example: Microsoft Word - Review.doc

  • DriverNameThe DriverName property indicates the name of the printer driver used for the print job.

  • ElapsedTimeLength of time that the job has been executing.

  • HostPrintQueueThe HostPrintQueue property contains the name of the computer on which the print job was created.

  • InstallDateThe InstallDate property is datetime value indicating when the object was installed. A lack of a value does not indicate that the object is not installed.

  • JobIdThe JobId property indicates the identifier number of the job. It is used by other methods as a handle to a single job spooling to the printer.

  • JobStatusA free form string representing the job's status.

  • NameThe Name property defines the label by which the object is known. When subclassed, the Name property can be overridden to be a Key property.

  • NotifyUser to be notified upon job completion or failure. This property is restricted to 16 characters under Windows 9x platforms.

  • OwnerUser that submitted the job.

  • PagesPrintedThe PagesPrinted property specifies the number of pages that have been printed. This value may be zero if the print job does not contain page delimiting information.

  • PaperLengthThe PaperLength property indicates the length of the paper.
    Example: 2794

  • PaperSizeThe PaperSize property indicates the size of the paper.
    Example: A4 or Letter

  • PaperWidthThe PaperWidth property indicates the width of the paper.
    Example: 2159

  • ParametersThe Parameters property indicates optional parameters to send to the print processor. See the PrintProcessor member for more information.

  • PrintProcessorThe PrintProcessor property indicates the print processor service used to process the print job. A printer processor works in conjunction with the printer driver to provide additional translation of printer data for the printer, and can also be used to provide special options such as a title page for the job.

  • PriorityPriority indicates the urgency or importance of execution of a job.

  • SizeThe Size property indicates the size of the print job.

  • SizeHighThe SizeHigh property indicates the size of the print job if the Size property exceeds 4,294,967,295 bytes.

  • StartTimeTime that the job was begun.

  • StatusThe Status property is a string indicating the current status of the object. Various operational and non-operational statuses can be defined. Operational statuses are "OK", "Degraded" and "Pred Fail". "Pred Fail" indicates that an element may be functioning properly but predicting a failure in the near future. An example is a SMART-enabled hard drive. Non-operational statuses can also be specified. These are "Error", "Starting", "Stopping" and "Service". The latter, "Service", could apply during mirror-resilvering of a disk, reload of a user permissions list, or other administrative work. Not all such work is on-line, yet the managed element is neither "OK" nor in one of the other states.

  • StatusMaskThe StatusMask property specifies a bitmap of the possible statuses relating to this print job.

  • TimeSubmittedTime that the job was submitted.

  • TotalPagesThe TotalPages property specifies the number of pages required to complete the job. This value may be zero if the print job does not contain page-delimiting information.

  • UntilTimeTime after which the job is invalid or should be stopped.


    Methods

  • PauseThe Pause method pauses a job in a print queue. If the job was currently printing, no other job will be printed. If the job wasn't printing yet, another unpaused print job may begin printing. The method can return the following values:
    0 - Success.
    5 - Access denied.
    Other - For integer values other than those listed above, refer to the documentation on the Win32 error codes.

  • ResumeThe Resume method continues a paused print job. The method can return the following values:
    0 - Success.
    5 - Access denied.
    Other - For integer values other than those listed above, refer to the documentation on the Win32 error codes.


    Example WQL

    SELECT * FROM Win32_PrintJob
    About this site information

    This contents is created by WMI having class information.
    WMI Environment is Windows Server 2008 R2 Enterprise Edition.

    This link is Microsoft documents for "Managing Windows with WMI".
    That is VB(Visual Basic) scripting sample.
    This link is Microsoft documents for "Advanced Programming Topics in WMI .NET".
    That is VB.net(Visual Basic .net) scripting sample.

  • WMI Library -
    http://library.wmifun.net/

    WMI useful by VB,VB.Net,VC,VC.Net,VC#.Net,VBS(WSH),PowerShell for PC asset management, system monitoring and collecting hardware and software inventory.
    原创粉丝点击