zoukankan      html  css  js  c++  java
  • 批处理自动安装打印机

    @echo off
    title 广州网络打印机自动安装程序         Powered By XXX     Telphone: XXX

    mode con cols=100 lines=20
    color F0
    Echo 正在帮你设置打印机,请稍候……
    net use \\192.168.70.12 /delete
    net use \\192.168.70.12 /user:user user 

    if exist "%windir%/System32/en-US/user32.dll.mui" (goto 12) else (goto 11)

    :
    11
    regedit 
    /s PrintXp.reg   
    net stop spooler
    net start spooler
    rundll32 printui
    .dll,PrintUIEntry /if /"FX DocuCentre 659 CP" /"IP_192.168.70.20" /"FX DocuCentre 659 CP" //"\\192.168.70.12\software\驱动程序\659\FXLOCJI.inf" /q
    rundll32 printui
    .dll,PrintUIEntry //"FX DocuCentre 659 CP" /q
    goto 13

    :
    12
    regedit 
    /s PrintVista.reg
    net stop spooler
    net start spooler
    rundll32 printui
    .dll,PrintUIEntry /if /"FX DocuCentre 659 CP" /"192.168.70.20" /"FX DocuCentre 659 CP" //"\\192.168.70.12\software\驱动程序\fujiPrinter\FXLOCJI.inf"
    rundll32 printui
    .dll,PrintUIEntry //"FX DocuCentre 659 CP" 
    goto 13

    :
    13
    echo.
    echo 打印机安装完成,请测试是否安装成功!
    echo.
    echo 如有问题,请手动连接打印机,具体操作请查看邮件中打印说明文档,谢谢!
    echo.
    pause
    echo.
    exit
     上次忘了提供Printvista.reg和PrintXP.reg的文件,现在补上:
      Printvista.reg ,将下面的文件复制并保存为reg文件。
    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
    "LprAckTimeout"=dword:000000b4

    [HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Control\Print\Monitors\Standard TCP/IP Port\Ports\192.168.70.40]
    "Protocol"=dword:00000001
    "Version"=dword:00000002
    "HostName"="192.168.70.40"
    "IPAddress"=""
    "HWAddress"=""
    "PortNumber"=dword:0000238c
    "SNMP Community"="public"
    "SNMP Enabled"=dword:00000000
    "SNMP Index"=dword:00000001
    "PortMonMibPortIndex"=dword:00000000

     PrintXP.reg 保存为REG文件

    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_192.168.70.40]
    "Protocol"=dword:00000001
    "Version"=dword:00000001
    "HostName"=""
    "IPAddress"="192.168.70.40"
    "HWAddress"=""
    "PortNumber"=dword:0000238c
    "SNMP Community"="public"
    "SNMP Enabled"=dword:00000000
    "SNMP Index"=dword:00000000

     
    另外,在DOS里面有个命令reg add,也是增加注册表文件,大家可以在命令行模式下输入reg /?来获取更多的信息。

  • 相关阅读:
    45_ansible概述、ansible基础 、ad-hoc、批量配置管理
    44_自定义镜像及仓库、持久化存储 、 Docker网络架构
    43_Docker概述、部署Docker、Docker镜像、Docker基本命令
    42_KVM简介、 Virsh管理 、 自定义虚拟机、虚拟设备管理
    41_iptables防火墙 filter表控制 扩展匹配 nat表典型应用
    40_系统审计 服务安全 Linux安全之打补丁
    39_加密与解密 AIDE入侵检测系统 扫描与抓包
    38_Linux基本防护 用户切换与提权 SSH访问控制 SELinux安全 、SSH访问控制 SELinux安全
    hdu5530
    bzoj3456
  • 原文地址:https://www.cnblogs.com/fangbo/p/1535849.html
Copyright © 2011-2022 走看看