所有Windows计算机都使用带有V4驱动程序的网络打印机//服务器/打印机。服务器端驱动程序的当前版本是V3。我希望删除V4打印机并使用驱动程序V3重新安装网络打印机。
如何检测是否使用了驱动程序版本V4并删除打印机?我需要在bat文件中实现这一点,但是我可以从bat文件中运行PowerShell命令。
发布于 2021-02-09 21:34:41
发布于 2021-03-18 13:46:35
我还没有检测到驱动程序是V3还是V4,但我知道正确的驱动程序是例如。施乐GPD PCL6 V5.733.11.0如果驱动程序是其他任何东西,我将删除和重新安装我的网络打印机。
for /f "tokens=*" %%i in ('powershell -c "Get-Printer -Name "\\%server%\%printerName%" | Select -ExpandProperty "DriverName""') do set "driver=%%i"
if not "%driver%"=="%correctDriver%" (
powershell -c "get-WmiObject -Class Win32_Printer | where{$_.ShareName -eq '%printerShareName%'} | remove-Printer"
TIMEOUT /T 3 /noBREAK >NUL
rundll32 printui.dll,PrintUIEntry /in /n \\%server%\%printerShareName%
)
https://serverfault.com/questions/1052937
复制相似问题