Board logo

标题: [系统相关] 小弟我请问,在printui中能不能,把一个命令设置发给全部的打印机 [打印本页]

作者: exci    时间: 2021-10-27 01:19     标题: 小弟我请问,在printui中能不能,把一个命令设置发给全部的打印机

就是我想把我电脑里面的所有打印机  全部 取消脱机状态,不要我一行一行的输入了
rundll32 printui.dll,PrintUIEntry /Xs /n "H1020" attributes -WorkOffline
rundll32 printui.dll,PrintUIEntry /Xs /n "C2900" attributes -WorkOffline
能用一行命令  不要分H1020和C2900 这些打印机名字···
作者: idwma    时间: 2021-10-27 07:37

  1. wmic path Win32_Printer set WorkOffline="false"
复制代码

作者: exci    时间: 2021-10-27 08:09

回复 2# idwma


  最好不用  wmic,因为是在别人电脑上运行的,我怕他们不懂得 要点击管理员身份运行·····
作者: idwma    时间: 2021-10-27 09:34

回复 3# exci
  1. for /f "tokens=7 delims=\" %%i in ('reg query HKLM\SYSTEM\CurrentControlSet\Control\Print\Printers /f * /k^|findstr "HKEY"') do rundll32 printui.dll,PrintUIEntry /Xs /n "%%i" attributes -WorkOffline
复制代码

作者: exci    时间: 2021-10-27 14:30

回复 4# idwma
哈哈哈哈,谢谢大哥,我真是属猪的,没有想到去 注册表看············再次谢谢大哥




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