您可以通过几次调用 printui 来完成此操作 -有关更多信息,请参阅此页面。听起来你想打电话
rundll32 printui.dll,PrintUIEntry /ga
Run Code Online (Sandbox Code Playgroud)
虽然我不确定如何通过网络上的 INF 文件指定打印机。
几年前,我写了一个脚本来通过网络安装打印机。此脚本旨在与通过 samba 共享的打印机一起使用,因此您无需指定驱动程序。如果您尝试添加未以这种方式共享的打印机,我不确定这是否可行。也许您可以以此为起点来弄清楚如何去做。
@echo off
::
::This script adds a single printer to the default user profile.
::NOTE: Printer names with spaces will NOT be accepted.
::Usage: run addprinters and follow onscreen directions
cls
echo This script adds the specified local or network printer
echo to the deafult account for all existing/new users.
echo *IMPORTATNT* Printer names with spaces will NOT be accepted.
echo *******************************************************
SET /P target=Enter target computer name (this compupter)
SET /P printer=Enter Printserver/Printername (do not include \\)
echo Attempting to add %printer% for all users on %target%
rundll32 printui.dll,PrintUIEntry /ga /c\\%target% /n\\%printer%
echo New printers will NOT appear until spooler is restarted.
SET /P reset=Reset print spooler Y/N?
if "%reset%"=="y" goto spooly
goto end
:spooly
start /wait sc \\%target% stop spooler
start /wait sc \\%target% start spooler
echo Print Spooler Service restarted.
:end
Run Code Online (Sandbox Code Playgroud)
如果您想尝试一下,只需将此文本保存到 .cmd 文件并运行它。
| 归档时间: |
|
| 查看次数: |
13705 次 |
| 最近记录: |