printer-control

Other

Control local and network printers on Windows to list printers, print files or text, check status, and set default printer with name matching support.

Install

openclaw skills install printer-control

Printer Control Skill

This skill enables agent-controlled printing on Windows systems.

⚠️ Security & Permissions

Requires explicit user authorization before any print operation. Printing consumes physical resources and can be disruptive.

Always confirm:

  • Which printer to use
  • What to print
  • Number of copies

Quick Start

List Available Printers

python scripts/list_printers.py

Or with PowerShell:

powershell -Command "Get-Printer | Select-Object Name, Type, Shared, PortName"

Print a Text File

python scripts/print_file.py --printer "Printer Name" --file "C:\path\to\file.txt"

Print Raw Text

python scripts/print_text.py --printer "Printer Name" --text "Hello, World!"

Set Default Printer

python scripts/set_default.py --printer "Printer Name"

Scripts

ScriptPurpose
list_printers.pyList all available printers
print_file.pyPrint a file to a specified printer
print_text.pyPrint raw text string
set_default.pySet default printer
printer_status.pyCheck printer status (online, paper, toner)

Dependencies

Option 1: pywin32 (Recommended for Windows)

pip install pywin32

Option 2: PowerShell (Built-in, no install needed)

The scripts automatically fall back to PowerShell if pywin32 is not available.

Usage Examples

Example 1: List printers and pick one

python scripts/list_printers.py
# Output shows available printers, pick one by name

Example 2: Print a document

python scripts/print_file.py --printer "HP LaserJet Pro" --file "report.pdf" --copies 2

Example 3: Print a quick note

python scripts/print_text.py --text "Meeting at 3pm" --printer "Office Printer"

Troubleshooting

"Printer not found"

  • Run list_printers.py to verify the exact printer name
  • Printer names are case-sensitive

"Access denied"

  • Some network printers require authentication
  • Check printer permissions

"pywin32 not available"

  • Scripts will auto-fallback to PowerShell
  • For best results, install pywin32: pip install pywin32

Print job stuck in queue

powershell -Command "Restart-Service -Name Spooler"

API Reference

See references/printer-api.md for detailed API documentation and Windows print subsystem details.