通过组策略下发批处理来安装网络打印机
添加网络打印机端口
cscript %WINDIR%\System32\Printing_Admin_Scripts\zh-CN\prnport.vbs -a -r port name -h 192.168.1.10 -o raw -n 9100
添加网络打印机驱动
cscript %WINDIR%\System32\Printing_Admin_Scripts\zh-CN\prndrvr.vbs -a -m "HP LaserJet Professional M1216nfh MFP" -v 3 -e "Windows x64" -i "Z:\工具软件\打印机驱动\HP M1216nfh MFP\HPM1210.inf" -h "Z:\工具软件\打印机驱动\HP M1216nfh MFP\"
-e 系统版本 -i 驱动文件所在路径,-h 驱动文件所在目录
删除同名的打印机
rundll32 printui.dll,PrintUIEntry /dl /n "printer name" /q rem
通过引用端口和打印机驱动安装打印机
cscript "C:\Windows\System32\Printing_Admin_Scripts\zh-CN\prnmngr.vbs" -a -p "printer name" -m "HP LaserJet Professional M1216nfh MFP" -r "port name"