起因:昨晚在win7共享打印機(jī)電腦升級(jí)了補(bǔ)丁,今天下午同事電腦(未升級(jí)過(guò)補(bǔ)丁)打印出現(xiàn)0x11b,但另一臺(tái)升級(jí)了補(bǔ)丁卻是正常連接的,打印一切OK。
過(guò)程:直接百度上看到的內(nèi)容大體邏輯都是卸載有關(guān)打印機(jī)的補(bǔ)丁,但win7找不到具體的補(bǔ)丁型號(hào)。所以直接換成谷歌搜索,找到不錯(cuò)的解決方案,并把該方案做成自動(dòng)化腳本,一步到位。
其他發(fā)現(xiàn):https://learn.microsoft.com/en-us/answers/questions/563223/windows-cannot-connect-to-the-printer-error-0x0000 在微軟官方論壇上卻沒(méi)看到這方面的詳細(xì)內(nèi)容說(shuō)明,說(shuō)實(shí)話(huà)挺意外的。
靈感來(lái)源:
https://www.technipages.com/how-to-fix-
windows-printer-error-0x0000011b/
https://www.partitionwizard.com/partitionmagic/error-0x0000011b.html
補(bǔ)上:
https://www.technipages.com/how-to-fix-
windows-printer-error-0x0000011b/
附源碼(補(bǔ)上對(duì)應(yīng)注釋?zhuān),在升?jí)過(guò)補(bǔ)丁的共享打印主機(jī)上運(yùn)行該腳本即可。
home.php?mod=space&uid=251666 以管理員權(quán)限運(yùn)行cmd
@%1 C:\Windows\SysWOW64\mshta.exe vbscript:CreateObject("Shell.Application").ShellExecute("cmd.exe","/c %~s0::","","runas",1)(window.close)&&exit
@cd /d "%~dp0"
@echo off
@rem 參考鏈接
@REM https://www.technipages.com/how-to-fix-windows-printer-error-0x0000011b/
@REM https://www.partitionwizard.com/partitionmagic/error-0x0000011b.html
@rem 禁用配置打印服務(wù)的遠(yuǎn)程過(guò)程調(diào)用(RPC)身份驗(yàn)證級(jí)別
home.php?mod=space&uid=120276 add "HKLM\SYSTEM\CurrentControlSet\Control\Print" /v "RpcAuthnLevelPrivacyEnabled" /t REG_DWORD /d 0 /f
@rem 卸載博客解決方案涉及到的補(bǔ)丁。
@wusa /uninstall /kb:5005565 /quiet
@wusa /uninstall /kb:5005566 /quiet
@wusa /uninstall /kb:5005568 /quiet
@wusa /uninstall /kb:5022497 /quiet
@wusa /uninstall /kb:5012170 /quiet
@wusa /uninstall /kb:5023706 /quiet
@wusa /uninstall /kb:5007186 /quiet
@rem 關(guān)閉打印機(jī)服務(wù)
home.php?mod=space&uid=35508 stop spooler
@rem 清理打印池
home.php?mod=space&uid=324026 /f /s /q C:\Windows\System32\spool\PRINTERS\*
@rem 啟動(dòng)打印機(jī)服務(wù)
@net start spooler
@pause