Export (0) Print
Expand All

Pause method of the Win32_PrintJob class

The Pause WMI class method suspends a print job.

This topic uses Managed Object Format (MOF) syntax. For more information about using this method, see Calling a Method.

Syntax


uint32 Pause();

Parameters

This method has no parameters.

Return value

Return codeDescription
0

Success

5

Access Denied

 

Examples

The Pause All Printers with Empty Print Queues VBScript code sample pauses any printers that have no pending print jobs.

The following VBScript code sample pauses all the print jobs on a print server.


strComputer = "." 
Set objWMIService = GetObject("winmgmts:" _ 
    & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2") 
 
Set colPrintJobs =  objWMIService.ExecQuery _ 
    ("Select * from Win32_PrintJob") 
 
For Each objPrintJob in colPrintJobs  
    objPrintJob.Pause 
Next 

Requirements

Minimum supported client

Windows Vista

Minimum supported server

Windows Server 2003

Namespace

\root\CIMV2

MOF

CIMWin32.mof

DLL

CIMWin32.dll

See also

Computer System Hardware Classes
Win32_PrintJob

 

 

Show:
© 2014 Microsoft