Board logo

标题: [系统相关] 批处理添加打印机驱动为啥大部分电脑上正常,有些电脑却报参数无效 [打印本页]

作者: lzpiheing    时间: 2022-2-21 20:47     标题: 批处理添加打印机驱动为啥大部分电脑上正常,有些电脑却报参数无效

  1. rundll32 printui.dll,PrintUIEntry /if /b "%printname%" /f %mypath% /r IP_%IP% /m "%printname%"
复制代码

作者: lzpiheing    时间: 2022-2-21 20:48

难道这个还需要开启什么服务么?? 我自己的电脑测试N遍都不会报错 正常使用,客户 有些电脑就报参数无效
作者: Batcher    时间: 2022-2-22 17:25

回复 2# lzpiheing


找一台报错的电脑,在执行rundll32命令之前,先echo一下看看各个变量获取到的值是否有特殊字符或其它异常,例如:
  1. echo rundll32 printui.dll,PrintUIEntry /if /b "%printname%" /f %mypath% /r IP_%IP% /m "%printname%"
  2. rundll32 printui.dll,PrintUIEntry /if /b "%printname%" /f %mypath% /r IP_%IP% /m "%printname%"
复制代码

作者: lzpiheing    时间: 2022-2-22 18:28

回复 3# Batcher


    下次碰到我再截图看看,感谢回复
作者: lzpiheing    时间: 2022-3-25 15:42

回复 3# Batcher


    已解决

Cscript %windir%/System32/Printing_Admin_Scripts/zh-CN/Prnport.vbs -a -r IP_%IP% -h %IP% -o raw -n 9100
echo 正在添加新打印机...
rundll32 printui.dll,PrintUIEntry /if /b "%printname%" /f %mypath% /r IP_%IP% /m "%printname%"

这两个命令之间要间隔下两秒
不然有的电脑就会提示参数错误
作者: lkxlkk    时间: 2022-11-30 16:03

回复 5# lzpiheing

你这是什么意思?没有明白




欢迎光临 批处理之家 (http://www.bathome.net/) Powered by Discuz! 7.2