1、echo offclsecho Trying to connect HP 2200 printrem 判断网络打印机 IP 是否连线:startecho off &ping -n 1 192.168.0.101 |find “timed out“ nul 2nul & echo Failed to connect ,continue install & goto endecho Ready to install & goto goon:goongoto end:endrem 在注册表中导入网络打印机的 IPregedit /s 11.regrem 重启打印机服务sc stop spooler
2、& sc start spooler rem 判断打印机服务是否已经启动,如果已启动就执行安装,这一段调试有些问题:start2echo off &sc query spooler |find “RUNNING“ nul IF NOT ERRORLEVEL 1 (echo Its OK)else(goto start2)echo Driver is being installed ,later this window will automatically closerem 安装打印机rundll32 printui.dll,PrintUIEntry /dl /n “HP LaserJet 2200 Series PCL 32“ /qrundll32 printui.dll,PrintUIEntry /if /b “HP LaserJet 2200 Series PCL 32“ /f “%windir%infntprint.inf“ /r “IP_192.168.0.101“ /m “HP LaserJet 2200 Series PCL“ /u /z