- name
- printer-control
- description
- Control local and network printers from your computer. Use when you need to: (1) List available printers, (2) Print text files or documents, (3) Print raw text to a specific printer, (4) Check printer status, (5) Set default printer. Supports Windows with win32print or PowerShell fallback. Now with partial name matching for easier printer selection.
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.pyOr 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\ o\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
| Script | Purpose |
|---|---|
list_printers.py | List all available printers |
print_file.py | Print a file to a specified printer |
print_text.py | Print raw text string |
set_default.py | Set default printer |
printer_status.py | Check printer status (online, paper, toner) |
Dependencies
Option 1: pywin32 (Recommended for Windows)
pip install pywin32Option 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 nameExample 2: Print a document
python scripts/print_file.py --printer "HP LaserJet Pro" --file "report.pdf" --copies 2Example 3: Print a quick note
python scripts/print_text.py --text "Meeting at 3pm" --printer "Office Printer"Troubleshooting
"Printer not found"
- Run
list_printers.pyto 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.