How to Manage Print Jobs from Command Line

How to Manage Print Jobs from Command Line or Command Prompt. In one of the previous articles, we have seen how to manage printers from the command line using some VBS scripts. In this article, I am going to explain how to manage the printer jobs using WMI command. We will learn how to pause the printer jobs, how to resume the paused jobs, how to delete the stuck up printer jobs.

How to Manage Print Jobs from Command Line –

How to Manage Print Jobs from Command Line

First, let’s see the list of jobs we have in the queues. For this, you need to run the below command.

wmic printjob get

The above will list all the jobs in progress/queue. It prints a lot of details about each printer job. To print only the minimal information we are interested in, we can use the below command.

wmic printjob get jobid, document, jobstatus

Example:

c:\>wmic printjob get jobid, document, jobstatus
Document      JobId  JobStatus
BankStatement  2      Error/Restart

How to Cancel print job –

You can cancel a print job using the below command. We need to provide the job id in the command.

wmic printjob where jobid=<jobnumber> delete

Example:

wmic printjob where jobid=2 delete

How to Pause a print job –

This command too would require you to specify the job id.

wmic printjob where jobid=<jobnumber> pause

Example:

c:\>wmic printjob where jobid=2 pause
Executing (\\WINCMD-PC\ROOT\CIMV2:Win32_PrintJob.Name="Myprinter, 2")->Pause()
Method execution successful.
Out Parameters:
instance of __PARAMETERS
{
        ReturnValue = 0;
};
c:\>wmic printjob get jobid, document, jobstatus
Document    JobId  JobStatus
BankStatement  2      Paused

How to Resume a paused print job –

wmic printjob where jobid=<jobnumber> resume

Thanks for reading this important topic about – How to Manage Print Jobs from Command Line.

Leave a Comment

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.