Win10打印功能(组件)恢复(修复)

一、 注册表
1、控制及类
pe-sys\ControlSet001\Control\Print
pe-sys\ControlSet001\Control\Class\{1ed2bbf9-11f0-4084-b21f-ad83a8e6dcdc}
pe-sys\ControlSet001\Control\Class\{4658ee7e-f050-11d1-b6bd-00c04fa372a7}
pe-sys\ControlSet001\Control\Class\{49ce6ac8-6f86-11d2-b1e5-0080c72e74a2}
pe-sys\ControlSet001\Control\Class\{4d36e979-e325-11ce-bfc1-08002be10318}
pe-sys\ControlSet001\Control\Class\{c30ecea0-11ef-4ef9-b02e-6af81e6e65c0}
pe-sys\ControlSet001\Control\Class\{c7bc9b22-21f0-4f0d-9bb6-66c229b8cd33}
2、服务
pe-sys\ControlSet001\Services\Spooler
pe-sys\ControlSet001\Services\usbprint(注意,如果组件外置,这一项不要,系统注册表中有的话也要删除)
3、usbprint.inf安装包数据库记录(这一步不是必须)
用RegWorkshop在pe-sys\DriverDatabase位置查找usbprint.inf再导出备用

以上三项均从INSTALL.WIM的SYSTEM中提取。
二、 文件列表
可以分成三部分
1、 设备与打印机
Windows
│  splwow64.exe
│  
├─inf
│      c_pnpprinters.inf
│      c_printer.inf
│      PrintQueue.inf
│      printupg.inf
│      usbprint.inf
│      
├─PrintDialog(注:整个目录,但似乎没什么用)
│          
└─System32
    │  AppMon.dll
    │  bidispl.dll
    │  compstui.dll
    │  DafPrintProvider.dll
    │  defaultdevicemanager.dll
    │  defaultprinterprovider.dll
    │  DevDispItemProvider.dll
    │  DeveloperOptionsSettingsHandlers.dll
    │  deviceassociation.dll
    │  DeviceCenter.dll
    │  DeviceDisplayStatusManager.dll
    │  DeviceDriverRetrievalClient.dll
    │  DeviceEject.exe
    │  DeviceElementSource.dll
    │  DeviceEnroller.exe
    │  DeviceMetadataRetrievalClient.dll
    │  DevicePairing.dll
    │  DevicePairingFolder.dll
    │  DevicePairingProxy.dll
    │  DevicePairingWizard.exe
    │  deviceregistration.dll
    │  DeviceSetupManager.dll
    │  DeviceSetupManagerAPI.dll
    │  DeviceSetupStatusProvider.dll
    │  DevicesFlowBroker.dll
    │  DeviceUxRes.dll
    │  devinv.dll
    │  DevPropMgr.dll
    │  DevQueryBroker.dll
    │  efswrt.dll
    │  FaxPrinterInstaller.dll
    │  FdDevQuery.dll
    │  fdPnp.dll
    │  fdprint.dll
    │  fdWNet.dll
    │  fdWSD.dll
    │  findnetprinters.dll
    │  fundisc.dll
    │  fxsapi.dll
    │  FXSMON.dll
    │  FXSRESM.dll
    │  gpprnext.dll
    │  hgprint.dll
    │  icm32.dll
    │  icmui.dll
    │  inetpp.dll
    │  inetppui.dll
    │  IPPMon.dll
    │  localspl.dll
    │  localui.dll
    │  mgmtapi.dll
    │  newdev.exe
    │  ntprint.dll
    │  ntprint.exe
    │  OpcServices.dll
    │  pcl.sep
    │  print.exe
    │  PrintBrmUi.exe
    │  PrintDialogHost.exe
    │  PrintDialogs.dll
    │  printfilterpipelineprxy.dll
    │  printfilterpipelinesvc.exe
    │  PrintIsolationHost.exe
    │  PrintIsolationProxy.dll
    │  printmanagement.msc
    │  PrintPlatformConfig.dll
    │  PrintRenderAPIHost.DLL
    │  printui.dll
    │  printui.exe
    │  PrintWSDAHost.dll
    │  prncache.dll
    │  prnfldr.dll
    │  prnntfy.dll
    │  prntvpt.dll
    │  pscript.sep
    │  puiapi.dll
    │  puiobj.dll
    │  rasadhlp.dll
    │  RepCurUser.cmd
    │  ReSpooler.cmd
    │  serialui.dll
    │  spoolss.dll
    │  spoolsv.exe
    │  srclient.dll
    │  srcore.dll
    │  sysprint.sep
    │  sysprtj.sep
    │  tcpmon.ini
    │  umb.dll
    │  usbmon.dll
    │  webservices.dll
    │  win32spl.dll
    │  Windows.Devices.Printers.dll
    │  Windows.Devices.Printers.Extensions.dll
    │  Windows.Graphics.dll
    │  Windows.Graphics.Printing.3D.dll
    │  Windows.Graphics.Printing.dll
    │  Windows.Internal.Shell.Broker.dll
    │  WLIDNSP.DLL
    │  WlS0WndH.dll
    │  WSDApi.dll
    │  WSDMon.dll(1903没有了)
    │  wsdprintproxy.dll
    │  WSDScanProxy.dll
    │  XpsDocumentTargetPrint.dll
    │  XpsFilt.dll
    │  XpsGdiConverter.dll
    │  XpsPrint.dll
    │  XpsRasterService.dll
    │  XPSServiceS.DLL
    │  XPSSHHDR.dll
    │  xwizard.exe
    │  xwizards.dll
    │  xwtpdui.dll
    │  xwtpw32.dll
    │  
    ├─CatRoot
    │  └─{F750E6C3-38EE-11D1-85E5-00C04FC295EE}(注:含Print字符的cat文件,其中~zh-cn类型的都可以不要)
    │          
    ├─drivers
    │      usbprint.sys
    │      
    ├─driverstore
    │  ├─en-US
    │  │      c_dot4print.inf_loc
    │  │      c_pnpprinters.inf_loc
    │  │      c_printer.inf_loc
    │  │      c_receiptprinter.inf_loc
    │  │      
    │  ├─FileRepository
    │  │  ├─c_dot4print.inf_x86_3a482d7106e67af5
    │  │  │      c_dot4print.inf
    │  │  │      
    │  │  ├─c_pnpprinters.inf_x86_332e93a45a3e656a
    │  │  │      c_pnpprinters.inf
    │  │  │      
    │  │  ├─c_printer.inf_x86_e6ba9e11e6380557
    │  │  │      c_printer.inf
    │  │  │      
    │  │  ├─c_receiptprinter.inf_x86_f0322e57fec0dc81
    │  │  │      c_receiptprinter.inf
    │  │  │      
    │  │  ├─printqueue.inf_x86_5599cddb064d37cf
    │  │  │      printqueue.inf
    │  │  │      
    │  │  └─usbprint.inf_x86_08d44a3fd742371d
    │  │          usbprint.inf
    │  │          usbprint.sys
    │  │          
    │  └─zh-CN
    │          bthprint.inf_loc
    │          PrintQueue.inf_loc
    │          usbprint.inf_loc
    │          
    ├─spool(整个目录)
    │              
    └─zh-CN(下面对应的文件)

2、 基本驱动
Windows
├─INF
│      ntprint.inf
│      ntprint4.inf
│      tsprint.inf
│      wsdprint.inf
│      
└─System32
    ├─catroot
    │  └─{F750E6C3-38EE-11D1-85E5-00C04FC295EE}
    │          ntprint.cat
    │          ntprint4.cat
    │          
    └─DriverStore
        ├─en-US
        │      ntprint4.inf_loc
        ├─FileRepository
        │  ├─ntprint.inf_x86_ab738c05d09b470b
        │  ├─ntprint4.inf_x86_9d6305e59342bba1
        │  ├─tsprint.inf_x86_af7e87be969e4e2c
        │  └─wsdprint.inf_x86_69b253d182b5dd8c
        └─zh-CN
                ntprint.inf_loc
                tsprint.inf_loc
                WSDPrint.inf_loc
3、 系统集成的驱动
Windows
└─System32
    ├─CatRoot
  │  └─{F750E6C3-38EE-11D1-85E5-00C04FC295EE}中PRN开头的数据
      └─DriverStore
          └─FileRepository下以PRN开头的目录

三、 处理
1、 注册表导入
把上述三项注册表导入PE的system中。
2、 spoolsv.exe的破解
因为HKEY_LOCAL_MACHINE\SYSTEM\Setup\SystemSetupInProgress=0打印才能开启,但影响装显卡等其他驱动。用二进制编辑器打开spoolsv.exe,搜索Unicode编码SystemSetupInProgress,这个串随便改动其中的任何一个字母就行。(18362似乎找不到也不需要破解)
也可以用PECMD的命令PUTF %Windir%\System32\spoolsv.exe,0x2D0C,0x54来修改的一个字母,其中偏移位置先找出来。
3、 安装的核心命令:
解压上述文件到系统中
ntprint.exe
net start spooler
PnPutil.exe -i -a "%Windir%\inf\usbprint.inf”
注意,如果数据库中没登记,可以直接PECMD脚本安装:FORX @%Windir%\System32\DriverStore\FileRepository\usbprint.inf*,inf,1,exec =*drvload.exe "%inf%\usbprint.inf"


如果你的打印机系统中已经集成,则可以直接使用了,如果没有可以自备驱动到设备管理中安装,或者可以安装网络共享的打印机,因为组件已经安装好了。
以上文件列表及方法以Win10 1709 16299为蓝本。近期看1803 18362去掉了好多系统自带驱动,如我的HPM1005一体机就没有自带驱动了。

按上述的列表和注册表信息,转成WimBuilder2的批处理,

Z:\WimBuilder2\Projects\WIN10XPE\01-Components\Printer\main.bat

代码如下:

rem ==========update filesystem==========

set AddFiles_Mode=merge
;devices and printers
call AddDrivers "c_pnpprinters.inf,c_printer.inf,PrintQueue.inf,printupg.inf,usbprint.inf"

;base drivers
call AddDrivers "ntprint4.inf,ntprint.inf,ntprint4.inf,tsprint.inf,wsdprint.inf"

call AddFiles %0 :end_files
goto :end_files

\Windows\splwow64.exe
\Windows\PrintDialog

\Windows\System32\drivers\usbprint.sys
@\Windows\System32\driverstore\en-US
;devices and printers
c_dot4print.inf_loc
c_pnpprinters.inf_loc
c_printer.inf_loc
c_receiptprinter.inf_loc

;base drivers
ntprint4.inf_loc

@\Windows\System32\driverstore\%WB_PE_LANG%
;devices and printers
bthprint.inf_loc
PrintQueue.inf_loc
usbprint.inf_loc

;base drivers
ntprint.inf_loc
tsprint.inf_loc
WSDPrint.inf_loc

@\Windows\System32\catroot\{F750E6C3-38EE-11D1-85E5-00C04FC295EE}\
*Print*
ntprint.cat
ntprint4.cat
prn*.cat
@\Windows\System32\DriverStore\FileRepository\prn*.inf*

@\Windows\System32\
AppMon.dll,bidispl.dll,compstui.dll,DafPrintProvider.dll,defaultdevicemanager.dll,defaultprinterprovider.dll
DevDispItemProvider.dll,DeveloperOptionsSettingsHandlers.dll,deviceassociation.dll
DeviceCenter.dll,DeviceDisplayStatusManager.dll,DeviceDriverRetrievalClient.dll
DeviceEject.exe,DeviceElementSource.dll,DeviceEnroller.exe,DeviceMetadataRetrievalClient.dll
DevicePairing.dll,DevicePairingFolder.dll,DevicePairingProxy.dll,DevicePairingWizard.exe
deviceregistration.dll,DeviceSetupManager.dll,DeviceSetupManagerAPI.dll,DeviceSetupStatusProvider.dll
DevicesFlowBroker.dll,DeviceUxRes.dll,devinv.dll,DevPropMgr.dll,DevQueryBroker.dll,efswrt.dll
FaxPrinterInstaller.dll,FdDevQuery.dll,fdPnp.dll,fdprint.dll,fdWNet.dll,fdWSD.dll,findnetprinters.dll
fundisc.dll,fxsapi.dll,FXSMON.dll,FXSRESM.dll,gpprnext.dll,hgprint.dll,icm32.dll,icmui.dll
inetpp.dll,inetppui.dll,IPPMon.dll,localspl.dll,localui.dll,mgmtapi.dll
newdev.exe,ntprint.dll,ntprint.exe,OpcServices.dll,pcl.sep,print.exe
PrintBrmUi.exe,PrintDialogHost.exe,PrintDialogs.dll,printfilterpipelineprxy.dll,printfilterpipelinesvc.exe
PrintIsolationHost.exe,PrintIsolationProxy.dll,printmanagement.msc,PrintPlatformConfig.dll,PrintRenderAPIHost.DLL
printui.dll,printui.exe,PrintWSDAHost.dll,prncache.dll,prnfldr.dll,prnntfy.dll,prntvpt.dll,pscript.sep
puiapi.dll,puiobj.dll,rasadhlp.dll,RepCurUser.cmd,ReSpooler.cmd,serialui.dll,spoolss.dll,spoolsv.exe,srclient.dll
srcore.dll,sysprint.sep,sysprtj.sep,tcpmon.ini,umb.dll,usbmon.dll,webservices.dll,win32spl.dll
Windows.Devices.Printers.dll,Windows.Devices.Printers.Extensions.dll
Windows.Graphics.dll,Windows.Graphics.Printing.3D.dll,Windows.Graphics.Printing.dll
Windows.Internal.Shell.Broker.dll,WLIDNSP.DLL,WlS0WndH.dll,WSDApi.dll,WSDMon.dll,wsdprintproxy.dll,WSDScanProxy.dll
XpsDocumentTargetPrint.dll,XpsFilt.dll,XpsGdiConverter.dll,XpsPrint.dll,XpsRasterService.dll,XPSServiceS.DLL,XPSSHHDR.dll
xwizard.exe,xwizards.dll,xwtpdui.dll,xwtpw32.dll
:end_files

call DoAddFiles

rem ==========update registry==========

call RegCopy SYSTEM\ControlSet001\Control\Print
call RegCopy SYSTEM\ControlSet001\Control\Class\{1ed2bbf9-11f0-4084-b21f-ad83a8e6dcdc}
call RegCopy SYSTEM\ControlSet001\Control\Class\{4658ee7e-f050-11d1-b6bd-00c04fa372a7}
call RegCopy SYSTEM\ControlSet001\Control\Class\{49ce6ac8-6f86-11d2-b1e5-0080c72e74a2}
call RegCopy SYSTEM\ControlSet001\Control\Class\{4d36e979-e325-11ce-bfc1-08002be10318}
call RegCopy SYSTEM\ControlSet001\Control\Class\{c30ecea0-11ef-4ef9-b02e-6af81e6e65c0}
call RegCopy SYSTEM\ControlSet001\Control\Class\{c7bc9b22-21f0-4f0d-9bb6-66c229b8cd33}

rem add services
call RegCopyEx Services Spooler

rem remove usbprint if this is additional component
call RegCopyEx Services usbprint

rem update spoolsv.exe binary
binmay.exe -u "%X_SYS%\spoolsv.exe" -s u:SystemSetupInProgress -r u:DisableSpoolsvInWinPE
fc /b "%X_SYS%\spoolsv.exe.org" "%X_SYS%\spoolsv.exe"
del /f /q "%X_SYS%\spoolsv.exe.org"

rem EnablePrintFeature
md "%X%\PEMaterial"
if 1==1 (
  echo ntprint.exe
  echo net start spooler
  echo PnPutil.exe -i -a "%%Windir%%\inf\usbprint.inf"
)>"%X%\PEMaterial\EnablePrintFeature.bat"
rem call link "%X%\PEMaterial\EnablePrintFeature.bat" "%X_Desktop%\EnablePrintFeature.lnk"
 

注意:从1903开始,需要加多如下这条注册表项:

Z:\WimBuilder2\Projects\WIN10XPE\01-Components\Devices and Printers\last.bat添加

reg add "HKEY_LOCAL_MACHINE\tmp_SOFTWARE\Microsoft\Windows NT\CurrentVersion\Notifications\Data" /v 41960B29A3BC0C75 /t REG_BINARY /d 0100000001000000 /f

经测试,并不是记事本不能打印,而是新的记事本可能默认使用雅黑字体,所以打印时出现参数错误。同时使用word有的文件也不能打印,发现也是用了非宋体。这些都是使用精简字体引起。

 

有时点打印时,打印机不提示也不动,空白文档,打印机可以打,再输几个字也可以打。至此怀疑是字体的问题,马上打开原文件,使用的是等线体,全选改宋体就可以打印。又把内核换原版字体,再试记事本也可以打了。

最后,关于打印时出现 “参数错误” 的问题,有时点打印时,打印机不提示也不动,这些都是使用精简字体引起,打印功能不能使用精简字体。切记一定要保持系统的字体是完整的!

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
修复Win10打印问题适用20版本后,您可以尝试以下方法: 1. 检查打印机连接:确保打印机正确连接到电脑的USB、蓝牙或Wi-Fi接口,并处于打开状态。如果使用无线打印机,请确保打印机与电脑在同一网络中。 2. 更新打印机驱动程序:打开设备管理器,找到打印机设备,右键点击并选择“更新驱动程序”。系统将自动搜索并安装最新的打印机驱动程序。如果 Windows 无法找到适当的驱动程序,您可以从打印机制造商的官方网站下载并手动安装最新驱动程序。 3. 检查打印机设置:在“设置”中,点击“设备”并选择“打印机和扫描仪”。确保所使用的打印机是默认打印机,并且没有被暂停或禁用。如果需要,您可以右键点击打印机图标进行相关设置更改。 4. 清除打印队列:在“设备”→“打印机和扫描仪”中,找到所使用的打印机,右键点击并选择“查看打印队列”。点击“文档”菜单,选择“取消所有文档”。然后重新启动计算机和打印机。 5. 重新安装打印机:如果以上方法仍无法解决问题,您可以尝试重新安装打印机。在“设备”→“打印机和扫描仪”中,找到所使用的打印机,右键点击并选择“删除设备”。然后重新安装打印机。 6. 更新Windows系统:确保您的Windows 10系统已经更新到最新版本。打开“设置”→“更新和安全性”→“Windows 更新”,点击“检查更新”。安装所有可用的更新来修复可能存在的问题。 如果上述方法仍无法解决问题,建议您联系打印机制造商的技术支持团队进行进一步的咨询和帮助。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值