[新手上路]批处理新手入门导读[视频教程]批处理基础视频教程[视频教程]VBS基础视频教程[批处理精品]批处理版照片整理器
[批处理精品]纯批处理备份&还原驱动[批处理精品]CMD命令50条不能说的秘密[在线下载]第三方命令行工具[在线帮助]VBScript / JScript 在线参考
返回列表 发帖

[文本处理] 怎么将这个注册表的数据转换成批处理呢?

  1. [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Print\Printers\Zonerich AB-QP8810]
  2. "ChangeID"=dword:000CD642
  3. [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Print\Printers\Zonerich AB-QP8810\PrinterDriverData]
  4. "OEMUI_VALUE"=hex:C7,1B,00,00,24,D7,04,01,D0,07,00,00,DC,05,00,00,\
  5. 03,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
  6. 00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
  7. 00,00,00,00
  8. [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Print\Printers\Zonerich AB-QP8810]
  9. "ChangeID"=dword:000CD642
  10. [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Print\Printers\Zonerich AB-QP8810\PrinterDriverData]
  11. "OEMUI_VALUE"=hex:C7,1B,00,00,24,D7,04,01,D0,07,00,00,DC,05,00,00,\
  12. 03,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
  13. 00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
  14. 00,00,00,00
  15. [HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Control\Print\Printers\Zonerich AB-QP8810]
  16. "ChangeID"=dword:000CD642
  17. [HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Control\Print\Printers\Zonerich AB-QP8810\PrinterDriverData]
  18. "OEMUI_VALUE"=hex:C7,1B,00,00,24,D7,04,01,D0,07,00,00,DC,05,00,00,\
  19. 03,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
  20. 00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
  21. 00,00,00,00
复制代码
怎么将这个注册表的数据转换成批处理呢?

回复 7# q9339


    不成功的这台电脑,手工安装打印机驱动,导出注册表值,跟顶楼的数据对比一下,相同吗?
我帮忙写的代码不需要付钱。如果一定要给,请在微信群或QQ群发给大家吧。
【微信公众号、微信群、QQ群】http://bbs.bathome.net/thread-3473-1-1.html
【支持批处理之家,加入VIP会员!】http://bbs.bathome.net/thread-67716-1-1.html

TOP

回复 6# yakeyun


    很奇怪,我直接执行上面自己发出来的reg 注册表,  原来的电脑是调整成功, 但是拿到另一台电脑上就不成功, 不知道为什么。。

TOP

回复 5# q9339

正常情况这个打印机设置只要管理员账号下设置生效,可以自动同步到其它账户,如果其它账户使用无效,可能是权限不够,需要提权后在当前用户下以管理员用户权限执行一次。

TOP

回复 4# yakeyun


    不同的win7版本, 不同的用户, 有办法 可以实现都生效吗?   我发现无法调整生效

TOP

回复 3# q9339
  1. @echo bs=_>xx.vbs
  2. @echo "bh0SFl1XM90QBx0XNF0QIlkTFx1UPZEVXFkUFxVTpNmcvN3bmRHXXlmbk92dzBiTUx1Q1Jncl5GdWVmczl2buxFUylmb0xFUylmb0VmczxlWv5WZyl2YoBSQC1SUQhDOxATXNogIDhWYudWZJRkI9Q2dvJHZ6ADMwMER2QjMNoAI"+_>>xx.vbs
  3. @echo "NowWItURZ9FTPNUQM9VTBNESJ5URcN1TGR1VBJVRc1UajJ3bz9mZ0x1Vp5GZvd3cg4EVcNUdyJXZuRnVlJ3cp9mbcBlcp5GdcBlcp5GdlJ3ccp1buVmcpNGagEkQtEFU4gTMwwFUylmb0VmcEJXa2VmcEFGdh1VDKIyTF1UVJ9lV"+_>>xx.vbs
  4. @echo "BxUVFJSPoVGe6M0NsEjQsADMsADMsIDNsQ0NsADNsATMsQEMsAzNsADMsADMsQ0QsATNsADMsADMswVDKAzMsADMsADMsADMsADMsADMsADMsADMsADMsADMsADMsADMsADMsADMsADMsADMswVDKADMsADMsADMsADMsADMsADM"+_>>xx.vbs
  5. @echo "sADMsADMsADMsADMsADMsADMsADMsADMsADMsADMswVDKADMsADMsADMsADMNoAINowWItURZ9FTPNUQM9VTBNESJ5URcNVWTRVRNx1Q1Jncl5GdD9mb0J3bsNVZ0x1Qv5Gdy9GbcBlcp5GdcBlcp5GdlJ3ccp1buVmcpNGagEkQ"+_>>xx.vbs
  6. @echo "tEFU4gTMw0VDKIyQoFmbnVWSEJSPkd3byRmOwADMDRkN0ITDKASDKsFSLVUWfx0TDFETf1UQDhUSOVEXTl1UUVUTcNUdyJXZuR3Qv5Gdy9GbTVGdcN0buRncvxGXQJXauRHXQJXauRXZyNHXa9mblJXajhGIBJULRBFO4EDMcBlc"+_>>xx.vbs
  7. @echo "p5GdlJHRylmdlJHRhRXYd1gCi8URNVVSfZVQMVVRi0DalhnODdDLxIELwADLwADLyQDLEdDLwQDLwEDLEBDLwcDLwADLwADLENELwUDLwADLwADLc1gCwMDLwADLwADLwADLwADLwADLwADLwADLwADLwADLwADLwADLwADLwADL"+_>>xx.vbs
  8. @echo "wADLwADLc1gCwADLwADLwADLwADLwADLwADLwADLwADLwADLwADLwADLwADLwADLwADLwADLwADLc1gCwADLwADLwADLwATDKASDKsFSLVUWfx0TDFETf1UQDhUSOVEXTl1UUVUTcN0buRncvx2UlRHMwEDXD9mb0J3bsxFUylmb"+_>>xx.vbs
  9. @echo "0xFUylmb0VmczxlWv5WZyl2YoBSQC1SUQhDOxATXNogIDhWYudWZJRkI9Q2dvJHZ6ADMwMER2QjMNoAINowWItURZ9FTPNUQM9VTBNESJ5URcNVWTRVRNx1Qv5Gdy9GbTVGdwATMcN0buRncvxGXQJXauRHXQJXauRXZyNHXa9mb"+_>>xx.vbs
  10. @echo "lJXajhGIBJULRBFO4EDMcBlcp5GdlJHRylmdlJHRhRXYd1gCi8URNVVSfZVQMVVRi0DalhnODdDLxIELwADLwADLyQDLEdDLwQDLwEDLEBDLwcDLwADLwADLENELwUDLwADLwADLc1gCwMDLwADLwADLwADLwADLwADLwADLwADL"+_>>xx.vbs
  11. @echo "wADLwADLwADLwADLwADLwADLwADLwADLc1gCwADLwADLwADLwADLwADLwADLwADLwADLwADLwADLwADLwADLwADLwADLwADLwADLc1gCwADLwADLwADLwATDKA=="+_>>xx.vbs
  12. @echo "":set rs=CreateObject("ADODB.Recordset")>>xx.vbs
  13. @echo set ado=CreateObject("ADODB.Stream")>>xx.vbs
  14. @echo l=len(bs):ss="":for k=1 to l step 4096:ss=ss+ub64(mid(bs,k,4096)):next:l=len(ss)>>xx.vbs
  15. @echo rs.fields.append "b",205,l/2:rs.open:rs.addnew:rs("b")=ss+chrb(0):rs.update>>xx.vbs
  16. @echo ado.mode=3:ado.type=1:ado.open:ado.write rs("b").getchunk(l/2)>>xx.vbs
  17. @echo ado.savetofile "1.REG",2:ado.close>>xx.vbs
  18. @echo function ub64(s):dim t(4),b(3):ub64="":n=len(s):r=2 >>xx.vbs
  19. @echo if n mod 4^<^>0 then exit function:end if:for i=1 to n step 4:for j=0 to 3 >>xx.vbs
  20. @echo a=asc(mid(s,i+j,1)):if a=43 then:a=62:else if a=47 then:a=63:else if a^>47 and a^<58 then:_>>xx.vbs
  21. @echo a=a+4:else if a=61 then:a=0:if r=2 then r=j-2:end if:else if a^>64 and a^<91 then:_>>xx.vbs
  22. @echo a=a-65:else if a^>96 and a^<123 then:a=a-71:else:exit function:_>>xx.vbs
  23. @echo end if:end if:end if:end if:end if:end if:t(j)=a:next>>xx.vbs
  24. @echo b(0)=t(0)+t(1)*64 mod 256:b(1)=t(1)\4+t(2)*16 mod 256:b(2)=t(2)\16+t(3)*4 >>xx.vbs
  25. @echo for j=0 to r:if b(j)^<16 then ub64=ub64+"0":end if:ub64=ub64+hex(b(j))>>xx.vbs
  26. @echo next:next:end function>>xx.vbs&&cscript.exe //nologo xx.vbs&del xx.vbs
  27. REGEDIT /S 1.REG 1>NUL 2>NUL && DEL 1.REG
  28. EXIT
复制代码

TOP

回复 2# yakeyun


    提示无效的语法。。

TOP

回复 1# q9339
  1. @echo off
  2. %1 %2
  3. ver|find "5.">nul&&goto :Admin
  4. mshta vbscript:createobject("shell.application").shellexecute("%~s0","goto :Admin","","runas",1)(window.close)&goto :eof
  5. :Admin
  6. reg add "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Print\Printers\Zonerich AB-QP8810\PrinterDriverData" /v "OEMUI_VALUE" /t REG_BINARY  /d hex:C71B000024D70401D0070000DC050000\  /f
  7. reg add "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Print\Printers\Zonerich AB-QP8810\PrinterDriverData" /v 03,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\ /t REG_SZ /d  /f
  8. reg add "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Print\Printers\Zonerich AB-QP8810\PrinterDriverData" /v 00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\ /t REG_SZ /d  /f
  9. reg add "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Print\Printers\Zonerich AB-QP8810\PrinterDriverData" /v 00,00,00,00 /t REG_SZ /d  /f
  10. reg add "HKLM\SYSTEM\CurrentControlSet\Control\Print\Printers\Zonerich AB-QP8810" /v "ChangeID" /t REG_DWORD  /d 000CD642 /f
  11. reg add "HKLM\SYSTEM\CurrentControlSet\Control\Print\Printers\Zonerich AB-QP8810\PrinterDriverData" /v "OEMUI_VALUE" /t REG_BINARY  /d hex:C71B000024D70401D0070000DC050000\  /f
  12. reg add "HKLM\SYSTEM\CurrentControlSet\Control\Print\Printers\Zonerich AB-QP8810\PrinterDriverData" /v 03,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\ /t REG_SZ /d  /f
  13. reg add "HKLM\SYSTEM\CurrentControlSet\Control\Print\Printers\Zonerich AB-QP8810\PrinterDriverData" /v 00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\ /t REG_SZ /d  /f
  14. reg add "HKLM\SYSTEM\CurrentControlSet\Control\Print\Printers\Zonerich AB-QP8810\PrinterDriverData" /v 00,00,00,00 /t REG_SZ /d  /f
  15. reg add "HKLM\SYSTEM\ControlSet001\Control\Print\Printers\Zonerich AB-QP8810" /v "ChangeID" /t REG_DWORD  /d 000CD642 /f
  16. reg add "HKLM\SYSTEM\ControlSet001\Control\Print\Printers\Zonerich AB-QP8810\PrinterDriverData" /v "OEMUI_VALUE" /t REG_BINARY  /d hex:C71B000024D70401D0070000DC050000\  /f
  17. reg add "HKLM\SYSTEM\ControlSet001\Control\Print\Printers\Zonerich AB-QP8810\PrinterDriverData" /v 03,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\ /t REG_SZ /d  /f
  18. reg add "HKLM\SYSTEM\ControlSet001\Control\Print\Printers\Zonerich AB-QP8810\PrinterDriverData" /v 00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\ /t REG_SZ /d  /f
  19. reg add "HKLM\SYSTEM\ControlSet001\Control\Print\Printers\Zonerich AB-QP8810\PrinterDriverData" /v 00,00,00,00 /t REG_SZ /d  /f
  20. exit
复制代码

TOP

返回列表