打印机状态守护Printer Status Guard 让 Windows 不再对卡纸、缺纸、缺墨「装哑巴」 Stop Windows from staying silent about jams, empty trays and low toner

一个免安装、单文件的 Windows 小工具,把打印机的真实状态主动推送到你的桌面通知。两条互补路线:一条治本(启用端口 SNMP,让系统原生显示),一条兜底(常驻哨兵轮询 IPP,异常立刻弹通知)。 A portable, single-file Windows utility that pushes real printer status to your desktop. Two complementary routes: fix it at the source (enable port SNMP so Windows shows status natively), and fall back to a resident sentinel that polls IPP and fires a notification on any anomaly.

免安装No install 单文件 exeSingle .exe Windows 10 / 11Windows 10 / 11 MIT 许可MIT License 零外部依赖Zero dependencies

为什么需要它Why it exists

打印机卡纸、缺纸时,Windows 默认经常毫无提示——打印任务悄悄卡住,你走到打印机前才发现。这台机器上我们实测过:那台 Pantum 的 Windows 原生两条状态通道(SNMP、WSD)都用不了,DetectedErrorState 恒为 0。本工具不依赖它们,直接自己问打印机。 When a printer jams or runs out of paper, Windows often says nothing — jobs stall silently and you only discover it by walking over. On the very machine this was built for, both native Windows status channels (SNMP and WSD) were unusable and DetectedErrorState stayed 0. This tool asks the printer directly instead.

两条互补的路线Two complementary routes

路线 A 让系统自己能显示状态;路线 B 在系统看不到的时候,依然主动告诉你。 Route A makes Windows itself show the status; Route B keeps telling you even when the OS cannot see it.

路线 A · 治本Route A · Root fix

启用端口 SNMPEnable port SNMP

给打印机的「标准 TCP/IP 端口」打开 SNMP 并重启后台打印服务。开启后,Windows 原生就能在设备和打印机里显示缺纸 / 缺墨,无需任何第三方软件常驻。Turn on SNMP for the printer's Standard TCP/IP Port and restart the Print Spooler. Windows then shows paper / toner status natively in Devices and Printers — nothing needs to stay resident.

  • 写入注册表端口键(SNMP Enabled / Community / Index)Writes the port registry keys (SNMP Enabled / Community / Index)
  • 需要管理员权限,工具会弹 UAC 提权Requires admin; the tool raises a UAC prompt
  • 一次性操作,做完即生效One-shot action, takes effect immediately
⚠️ SNMP(RFC 2790)覆盖进纸盘空 / 耗材缺失,但没有卡纸位——这正是路线 B 存在的理由。⚠️ SNMP (RFC 2790) covers empty trays and missing supplies, but has no jam bit — which is exactly why Route B exists.
路线 B · 兜底Route B · Fallback

IPP 哨兵 + SNMP 交叉确认IPP sentinel + SNMP cross-check

常驻托盘(可开机自启),定时向打印机 631 端口发 IPP 请求,解析 printer-state-reasons;同时读取 SNMP 错误位做交叉确认,两路合并后判定严重度。Stays in the tray (optional auto-start) and periodically sends IPP requests to port 631, parsing printer-state-reasons; it also reads SNMP error bits as a cross-check, then merges both channels to decide severity.

  • Toast 通知优先,失败自动回退托盘气泡Toast notifications first, falling back to tray balloons
  • 普通用户权限即可,无需提权Works at standard user level, no elevation
  • 轮询间隔可调,开机自启可选Adjustable poll interval, optional auto-start

关键能力Key capabilities

不止是"能弹通知"——真正花力气的是让它不误报、不漏报、不刷屏。 Not just "it can notify" — the hard part was making it not false-alarm, not miss events, and not spam you.

迟滞防抖Hysteresis (debounce)

扫描、打印、休眠唤醒会让打印机短暂不响应。异常立即上报并去重;而「离线」与「已恢复」都要求连续 3 次轮询稳定才通知。所以每扫一次文件就刷一串"恢复正常"的日子结束了。Scanning, printing and sleep make the printer briefly unreachable. Anomalies fire instantly (and are de-duplicated), while "offline" and "recovered" each require 3 consecutive stable polls. No more floods of "recovered" after every scan.

双通道合并Merged channels

IPP 与 SNMP 结果合并判定:任一通道报卡纸 / 缺纸 / 耗材相关位即判 Critical,其余告警判 Warning。既不漏报,也不会两条线路各弹一次。IPP and SNMP results are merged: a jam / empty paper / supply bit from either channel is Critical, other alerts are Warning. Nothing is missed and nothing is double-reported.

卡纸识别Jam detection

media-jam / paper-jam 映射为「卡纸」并判 Critical,走最高级别通知。厂商自定义 SNMP 位也不会被丢掉,会按 Warning 浮出。media-jam / paper-jam map to "jam" at Critical severity for highest-priority alerts. Vendor-specific SNMP bits are never dropped either — they surface as Warning.

日志诊断 TabDiagnostics log tab

记录工具与打印机的每一次交互:IPP 原始原因、SNMP 原始位域、合并结果、通知触发。支持 全部 / Info / Warning / Error 等级筛选,可清空、可打开日志目录。Records every interaction: raw IPP reasons, raw SNMP bit fields, the merged verdict, and notification triggers. Filter by All / Info / Warning / Error, clear, or open the log folder.

自检模式Self-test mode

无需界面即可验证核心逻辑:PrinterStatusGuard.exe -SelfTest,26 个用例覆盖 IPP 解析、SNMP 位域解码、双通道合并、迟滞防抖、注册表路径构造与深度体检全流程。Verify the core logic headlessly with PrinterStatusGuard.exe -SelfTest — 26 cases covering IPP parsing, SNMP bit-field decoding, channel merging, hysteresis, registry path construction and a full deep-checkup run.

深度体检Deep checkup

原独立工具 WinPrintDiag 已并入本程序:一键只读扫描打印服务、崩溃历史、组件签名、打印机-驱动配对(重复条目/错配判定)、队列堆积与审计日志,产出可另存的诊断报告;管理员可一键从组件存储还原被替换的组件。WinPrintDiag is now built in: a one-click read-only scan of the whole print subsystem — Spooler state, spoolsv crash history, binary signature integrity, printer/driver pairing (duplicates & mismatches), queue backlog and audit-log status. Admin can restore suspect binaries from WinSxS. The standalone winprintdiag repo is archived.

真正免安装Truly portable

单个 exe,放到任意目录双击即用;不写系统目录(除可选的开机自启注册表项),配置落在 %APPDATA%,卸载就是删文件。IPP 与 SNMP 客户端均为纯 .NET 实现。A single exe you can drop anywhere and double-click. It writes nothing to system folders (except an optional auto-start entry), keeps config in %APPDATA%, and uninstalling means deleting the file. The IPP and SNMP clients are pure .NET.

怎么用How to use

1
下载 exe 双击运行(或运行 .cmd 启动器,它会优先找 exe)。 Download the exe and run it (or run the .cmd launcher, which prefers the exe).
2
路线 A:选中打印机的 TCP/IP 端口 →「启用选中端口 SNMP」(需管理员)。 Route A: select the printer's TCP/IP port → "Enable SNMP" (requires admin).
3
路线 B:点「添加当前网络打印机」→ 设置轮询间隔 → 「开始哨兵」。可勾选开机自启。 Route B: click "Add current network printers" → set the interval → "Start sentinel". Auto-start is optional.
4
关闭主窗口会最小化到托盘;需要更新 exe 时请先从托盘右键退出,否则文件被占用无法覆盖。 Closing the window only minimizes to the tray. Before replacing the exe, right-click the tray icon and exit, otherwise the file stays locked.
📌 拿到打印机 IP 后如果想手动确认通道是否可用:浏览器打开 http://<打印机IP>:631 能通说明 IPP 可用。 📌 To confirm the channel manually: if http://<printer-IP>:631 opens in a browser, IPP is available.

运行要求与权限Requirements & permissions

系统SystemWindows 10 / 11,含 .NET Framework 4.xWindows 10 / 11 with .NET Framework 4.x
运行时RuntimeWindows PowerShell 5.1(系统自带)Windows PowerShell 5.1 (built in)
路线 A 权限Route A permission管理员(写注册表 + 重启 Spooler)Admin (writes registry + restarts Spooler)
路线 B 权限Route B permission普通用户即可,仅发网络请求Standard user; network requests only
配置位置Config location%APPDATA%\PrinterStatusGuard\%APPDATA%\PrinterStatusGuard\
数据收集Data collection不收集任何数据,全部本地处理Collects nothing; everything stays local

开始守护你的打印机Start guarding your printer

免安装、MIT 许可、开源。下载单个 exe 即可使用。 Portable, MIT-licensed and open source. Download a single exe and go.