← 返回
未分类 中文

printer-control

Control local and network printers on Windows to list printers, print files or text, check status, and set default printer with name matching support.
Control local and network printers on Windows to list printers, print files or text, check status, and set default printer with name matching support.
zhangpl666ya zhangpl666ya 来源
未分类 clawhub v1.0.0 1 版本 100000 Key: 无需
★ 0
Stars
📥 647
下载
💾 0
安装
1
版本
#latest

概述

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.

版本历史

共 1 个版本

  • v1.0.0 当前
    2026-05-01 21:36 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

office-efficiency

Word / DOCX

ivangdavila
创建、检查和编辑 Microsoft Word 文档及 DOCX 文件,支持样式、编号、修订记录、表格、分节符及兼容性检查等功能。
★ 456 📥 151,324
office-efficiency

Gog

steipete
Google Workspace 命令行工具,支持 Gmail、日历、云端硬盘、通讯录、表格和文档。
★ 925 📥 186,583
office-efficiency

Excel / XLSX

ivangdavila
创建、检查和编辑 Microsoft Excel 工作簿及 XLSX 文件,支持可靠的公式、日期、类型、格式、重算及模板保留功能。
★ 380 📥 143,893