注册表里,直接加reg add吗?不是很明白……。
我想把下面两个脚本合并成一个。- @echo off
- color 0A
- echo.
- echo.
- echo.
- rem 自动判断电脑是32位还是64位
- if /i "%PROCESSOR_IDENTIFIER:~0,3%"=="X86" (goto 32bit) ELSE (goto 64bit)
-
- :64bit
- echo 正在为您安装64位打印机驱动
- echo.
- rem 导入添加端口的注册表文件
- reg import 17wysh.reg ####应该是把注册表加到这吧?但我不知道用什么命令~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- if errorlevel 0 echo 网络打印机端口安装成功
- echo.
- echo 正在重启打印服务,请稍等……
- echo.
- rem 必须重启打印服务才能成功添加端口
- net stop spooler>nul
- net start spooler>nul
- if errorlevel 0 echo 打印服务重启成功
- echo ..............................................
- echo ..............................................
- echo 删除已经存在的同名打印机
- rundll32 printui.dll,PrintUIEntry /dl /n "HP LaserJet MFP M725 PCL 6" /q
- echo.
- echo 安装HP LaserJet MFP M725 PCL 6打印机......
- echo.
- rundll32 printui.dll,PrintUIEntry /if /b "HP LaserJet MFP M725 PCL 6(17层文印室)" /f \\11.150.191.219\02常用驱动\1HP打印驱动\laserjet_m725\x64\hpcm725u.inf /r "IP_11.150.169.117" /m "HP LaserJet MFP M725 PCL 6" /z
- if errorlevel 0 echo 打印机安装成功
- echo.
- rem 安装好打印机后,也可以在批处理文件最后加一行命令,把这个打印机设置为默认。
- echo.
- echo 将这个打印机设置为默认打印机
- rundll32 printui.dll,PrintUIEntry /y /n "HP LaserJet MFP M725 PCL 6(17层文印室)"
- goto end
-
- :32bit
- echo 正在为您安装32位打印机驱动
- echo.
- reg import 17wysh.reg ####应该是把注册表加到这吧?但我不知道用什么命令~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- if errorlevel 0 echo 网络打印机端口安装成功
- echo.
- echo 正在重启打印服务,请稍等……
- echo.
- net stop spooler>nul
- net start spooler>nul
- if errorlevel 0 echo 打印服务重启成功
- echo ..............................................
- echo ..............................................
- echo 删除已经存在的同名打印机
- rundll32 printui.dll,PrintUIEntry /dl /n "HP LaserJet MFP M725 PCL 6" /q
- echo.
- echo 安装HP LaserJet MFP M725 PCL 6......
- echo.
- rundll32 printui.dll,PrintUIEntry /if /b "HP LaserJet MFP M725 PCL 6(17层文印室)" /f \\11.150.191.219\02常用驱动\1HP打印驱动\laserjet_m725\x86\hpcm725c.inf /r "IP_11.150.169.117" /m "HP LaserJet MFP M725 PCL 6" /z
- if errorlevel 0 echo 打印机安装成功
- echo.
- echo.
- echo 将这个打印机设置为默认打印机
- rundll32 printui.dll,PrintUIEntry /y /n "HP LaserJet MFP M725 PCL 6(17层文印室)"
-
- :end
- echo 请按任意键退出
- pause>nul
复制代码 如何把这个注册表转换成BAT……- Windows Registry Editor Version 5.00
-
- [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Print\Monitors\Standard TCP/IP Port\Ports]
- "StatusUpdateInterval"=dword:0000000a
- "StatusUpdateEnabled"=dword:00000001
- [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Print\Monitors\Standard TCP/IP Port\Ports\IP_11.150.169.117]
- "Protocol"=dword:00000002
- "Version"=dword:00000002
- "HostName"="11.150.169.117"
- "IPAddress"=""
- "HWAddress"=""
- "PortNumber"=dword:00000203
- "SNMP Community"="public"
- "SNMP Enabled"=dword:00000001
- "SNMP Index"=dword:00000001
- "PortMonMibPortIndex"=dword:00000001
- "Queue"="print"
- "Double Spool"=dword:00000000
-
-
- [HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Control\Print\Monitors\Standard TCP/IP Port\Ports]
- "StatusUpdateInterval"=dword:0000000a
- "StatusUpdateEnabled"=dword:00000001
- [HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Control\Print\Monitors\Standard TCP/IP Port\Ports\IP_11.150.169.117]
- "Protocol"=dword:00000002
- "Version"=dword:00000002
- "HostName"="11.150.169.117"
- "IPAddress"=""
- "HWAddress"=""
- "PortNumber"=dword:00000203
- "SNMP Community"="public"
- "SNMP Enabled"=dword:00000001
- "SNMP Index"=dword:00000001
- "PortMonMibPortIndex"=dword:00000001
- "Queue"="print"
- "Double Spool"=dword:00000000
复制代码
|