大网数据广告活动
Windows排障命令

prndrvr

· 52CE 我爱测

Reference article for the prndrvr command, which adds, deletes, and lists printer drivers.

Adds, deletes, and lists printer drivers. This command is a Visual Basic script located in the %WINdir%\System32\printing_Admin_Scripts\<language> directory. To use this command at a command prompt, type cscript followed by the full path to the prndrvr file, or change directories to the appropriate folder. For example: cscript %WINdir%\System32\printing_Admin_Scripts\en-US\prndrvr.

Used without parameters, prndrvr displays command-line help.

Syntax

cscript prndrvr {-a | -d | -l | -x | -?} [-m <model>] [-v {0|1|2|3}] [-e <environment>] [-s <Servername>] [-u <Username>] [-w <password>] [-h <path>] [-i <inf file>]

Parameters

Parameter Description
-a Installs a driver.
-d Deletes a driver.
-l Lists all printer drivers installed on the server specified by the -s parameter. If you don't specify a server, Windows lists the printer drivers installed on the local computer.
-x Deletes all printer drivers and additional printer drivers not in use by a logical printer on the server specified by the -s parameter. If you don't specify a server to remove from the list, Windows deletes all unused printer drivers on the local computer.
-m <model_name> Specifies (by name) the driver you want to install. Drivers are often named for the model of printer they support. See the printer documentation for more information.
`-v {0 1
-e <environment> Specifies the environment for the driver you want to install. If you don't specify an environment, the environment of the computer where you are installing the driver is used. The supported environment parameters are: Windows NT x86, Windows x64 or Windows IA64.
-s <Servername> Specifies the name of the remote computer that hosts the printer that you want to manage. If you don't specify a computer, the local computer is used.
-u <Username> -w <password> Specifies an account with permissions to connect to the computer that hosts the printer that you want to manage. All members of the target computer's local Administrators group have these permissions, but the permissions can also be granted to other users. If you don't specify an account, you must be logged on under an account with these permissions for the command to work.
-h <path> Specifies the path to the driver file. If you don't specify a path, the path to the location where Windows was installed is used.
-i <filename.inf> Specifies the complete path and file name for the driver you want to install. If you don't specify a file name, the script uses one of the inbox printer .inf files in the inf subdirectory of the Windows directory.if the driver path is not specified, the script searches for driver files in the driver.cab file.
/? Displays help at the command prompt.
Remarks
  • If the information that you supply contains spaces, use quotation marks around the text (for example, "Computer Name").

  • The -x parameter deletes all additional printer drivers (drivers installed for use on clients running alternate versions of Windows), even if the primary driver is in use. If the fax component is installed, this option also deletes fax drivers. The primary fax driver is deleted if it is not in use (that is, if there is no queue using it). If the primary fax driver is deleted, the only way to re-enable fax is to reinstall the fax component.

Examples

To list all drivers on the local \printServer1 server, type:

cscript prndrvr -l -s

To add a version 3 Windows x64 printer driver for the Laser printer model 1 model of printer using the c:\temp\Laserprinter1.inf driver information file for a driver stored in the c:\temp folder, type:

cscript prndrvr -a -m Laser printer model 1 -v 3 -e Windows x64 -i c:\temp\Laserprinter1.inf -h c:\temp

To delete a version 3 Windows x64 printer driver for Laser printer model 1, type:

cscript prndrvr -a -m Laser printer model 1 -v 3 -e Windows x64

Related links

Source: Microsoft Learn / Windows Server documentation by Microsoft and contributors (upstream author metadata: robinharwood). Documentation licensed CC BY 4.0. Code samples are covered by the MIT License. Converted from Markdown, with links normalized and embedded media omitted.

资料来源与适用范围

资料来源
Microsoft Learn / Windows Server documentation
适用范围
Windows Server · Source date 10/16/2017
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY 4.0 (documentation), MIT (code samples)

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。