\\ Amazon 在庫処分セール 掘り出し物をチェックしよう //

How to Use the prnjobs Command for Print Job Management | Managing Print Queues in Windows

The prnjobs command in Windows allows users to manage print jobs directly from the command line. This tool is particularly useful for pausing, resuming, or canceling print jobs and monitoring the status of the print queue. It can also manage printers on remote computers, making it ideal for troubleshooting print issues and efficiently managing print jobs in large networks.

目次

What is the prnjobs Command?

The prnjobs command is a Windows command-line tool used to manage print jobs in the print queue. It allows users to view, pause, resume, and cancel print jobs, making it a valuable tool for handling print tasks, especially in network environments. Additionally, it can access remote printers and control their print jobs, helping administrators resolve printing issues quickly.

Main Uses

  • View Print Jobs: List all active print jobs in the print queue.
  • Pause, Resume, or Cancel Print Jobs: Control specific print jobs by pausing, resuming, or canceling them.
  • Remote Printer Management: Manage print queues on printers hosted on remote computers.

How to Use the prnjobs Command

https://twitter.com/tama_global/status/1846720607754629389

The prnjobs command is executed to retrieve information about the print queue and manage specific jobs. It provides administrators with options to control print jobs, either locally or on remote systems.

Basic Syntax

prnjobs [-Z | -M | -X] [-s <Servername>] -p <Printername> -j <JobID> [-u <Username> -w <Password>]
ParameterDescription
-ZPauses the specified print job (-j).
-MResumes the specified print job (-j).
-XCancels the specified print job (-j).
-lLists all current print jobs in the print queue.
-s <Servername>Specifies the remote computer hosting the printer. Defaults to the local machine if not specified.
-p <Printername>Required. Specifies the name of the printer.
-j <JobID>Specifies the print job ID to manage.
-u <Username> -w <Password>Specifies the credentials to access the remote computer hosting the printer.
/?Displays help for the command.

Example Usages

  1. List Current Print Jobs
    Display the list of active print jobs for a specified printer.
   prnjobs -p \\networkprinter\printer1 -l

Description: Lists all print jobs for the printer \\networkprinter\printer1, showing details such as job ID, sender, status, and more.

  1. Pause a Specific Print Job
    Use the -Z option to pause a print job by its job ID.
   prnjobs -p \\networkprinter\printer1 -j 123 -Z

Description: Pauses print job ID 123 on the printer \\networkprinter\printer1. The job remains in the queue until resumed.

  1. Resume a Paused Print Job
    Use the -M option to resume a paused print job.
   prnjobs -p \\networkprinter\printer1 -j 123 -M

Description: Resumes print job ID 123, allowing it to continue printing after being paused.

  1. Cancel a Print Job
    Use the -X option to cancel a print job by its job ID.
   prnjobs -p \\networkprinter\printer1 -j 123 -X

Description: Cancels and removes print job ID 123 from the print queue on \\networkprinter\printer1.

  1. Manage Print Jobs on a Remote Printer
    Use the -s option to manage print jobs on a printer hosted on a remote server.
   prnjobs -s \\server\printer2 -p \\networkprinter\printer2 -l

Description: Lists print jobs on the remote printer \\networkprinter\printer2, hosted on the server \\server.

Interpreting prnjobs Command Results

The output of the prnjobs command provides detailed information about each print job, including:

  • Job ID: A unique identifier for the print job.
  • Sender: The username of the person who sent the print job.
  • File Name: The name of the file being printed.
  • Pages: The number of pages in the print job.
  • Status: The current status of the job (e.g., printing, paused, error).

Example Output:

Job ID: 123
Sender: JohnDoe
File Name: report.docx
Pages: 5
Status: Printing

Description: This output shows that the print job report.docx is currently being printed, with additional details about the job.

Practical Applications of the prnjobs Command

Pausing and Resuming Print Jobs

In cases where multiple print jobs are sent to the printer simultaneously, some jobs may need to be paused temporarily. The prnjobs command allows administrators to pause specific jobs and resume them when needed.

prnjobs -p \\networkprinter\printer1 -j 124 -Z
prnjobs -p \\networkprinter\printer1 -j 124 -M

Description: Print job ID 124 is paused and then resumed, allowing for better control over job priorities.

Managing Network Printer Jobs

In corporate or large network environments, multiple users often share the same printer. The prnjobs command enables administrators to manage print jobs for all users, ensuring that print queues run smoothly.

prnjobs -s \\server\printer2 -p \\networkprinter\printer2 -X 125

Description: Cancels print job ID 125 on the remote printer \\networkprinter\printer2, helping to clear stalled or problematic jobs.

Important Considerations

  • Administrator Privileges Required: Some prnjobs operations (particularly for remote printers) require administrator privileges. Run the command prompt as an administrator to ensure access to all functions.
  • Correct Printer and Job ID: Be sure to specify the correct printer name and job ID. Incorrect information may cause unintended changes to other print jobs.

When to Use the prnjobs Command

The prnjobs command is particularly useful when you need detailed control over print jobs or need to troubleshoot printing issues. It is ideal for environments where multiple users share network printers and print job management is essential to smooth operations.

Conclusion

The prnjobs command is a powerful tool for managing print jobs in Windows. It allows users and administrators to monitor, pause, resume, and cancel print jobs from the command line. This command is especially useful in networked environments where quick resolution of print job issues is critical to maintaining productivity.

Tamaglo

Thank you for reading!

執筆者:玉城 学(タマキ マナブ)

IT業界歴10年以上。ヘルプデスク・サーバーエンジニアとしてWindowsの設定、クラウド管理、PC最適化を担当。

現在はPC設定・Office活用の専門家として、ブログやYouTubeで情報を発信中。

詳しいプロフィールはこちら

Comments

To comment


The reCAPTCHA verification period has expired. Please reload the page.

The maximum upload file size: 2 MB. You can upload: image. Links to YouTube, Facebook, Twitter and other services inserted in the comment text will be automatically embedded. Drop file here

目次