Поделиться через


Prndrvr.vbs

Adds, deletes, and lists printer drivers. Used without parameters, prndrvr.vbs displays command-line help for the prndrvr.vbs command.

To install a printer driver

Syntax

cscript prndrvr.vbs -a [-m DriverName] [-v {0 | 1 | 2 | 3}] [-e Environment] [-s RemoteComputer] [-h Path] [-i FileName**.inf**] [-u UserName -w Password]

Parameters

-a   : Required. Specifies that you want to install a driver.

-m   DriverName   : 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 | 2 | 3 } : Specifies the version of the driver you want to install. See the description of the -e Environment parameter for information on which versions are available for which environment. If you do not specify a version, the version of the driver appropriate for the version of Windows running on the computer on which you are installing the driver is installed.

  • Version 0 supports Windows 95, Windows 98, and Windows Millennium Edition.

  • Version 1 supports Windows NT 3.51.

  • Version 2 supports Windows NT 4.0.

  • Version 3 supports Windows XP and Windows 2000.

-e   Environment   : Specifies the environment for the driver you want to install. If you do not specify an environment, the environment of the computer on which you are installing the driver is used. The following table lists the driver environments that are available and the versions that are available for each.

Environment

Available versions

"Windows NT x86"

1, 2, and 3

"Windows NT Alpha_AXP"

1 and 2

"Windows IA64"

3

"Windows NT R4000"

1

"Windows NT PowerPC"

1

"Windows 4.0"

0

-s   RemoteComputer   : Specifies the remote computer on which you want to install the driver. If you do not specify a computer, the driver is installed on the local computer.

-h   Path   : Specifies the path to the driver file. If you do not specify a path, the path to the location from which Windows was installed is used.

-i   FileName .inf   : Specifies the file name for the driver you want to install. If you do not specify a file name, ntprint.inf is used.

-u   UserName   -w   Password   : Specifies an account with permissions to connect by using Windows Management Instrumentation (WMI) services to the computer on which you want to install the driver. All members of the Administrators group for that computer have these permissions, but the permissions can also be granted to other users. If you do not specify an account, you must be logged on under an account with these permissions for the command to work. For more information on WMI, see Related Topics.

/? : Displays help at the command prompt.

Remarks

  • This command starts a script that is located in the systemroot\system32 directory. You must type this command at a command prompt with that directory as the current directory, or you must type the full path to that directory at the beginning of the cscript command.

  • If the information that you supply contains spaces, use quotation marks around the text (for example, "Computer Name").

Example

To add version 3 of the printer driver named "Color Printer Driver 1" to the local computer, which offers a Windows NT x86-based environment, type:

cscript prndrvr.vbs -a -m "Color Printer Driver 1" -v 3 -e "Windows NT x86"

To delete a printer driver

Syntax

cscript prndrvr.vbs -d [-s RemoteComputer] -m DriverName -v {0 | 1 | 2 | 3-e Environment

[-u UserName -w Password]

Parameters

-d   : Required. Specifies that you want to delete a driver.

-s   RemoteComputer   : Specifies the remote computer from which you want to delete the driver. If you do not specify a computer, the driver is deleted from the local computer.

-m   DriverName   : Required. Specifies, by name, the driver you want to delete. Drivers are often named for the model of printer they support. See the printer documentation for more information.

-v { 0 | 1 | 2 | 3 } : Required. Indicates the version of the driver to be deleted. See the description of the -e Environment parameter for information on which versions are available in which environment.

  • Version 0 supports Windows 95, Windows 98, and Windows Millennium Edition.

  • Version 1 supports Windows NT 3.51.

  • Version 2 supports Windows NT 4.0.

  • Version 3 supports Windows XP and Windows 2000.

-e   Environment   : Required. Specifies the environment for the driver you want to delete. The following table lists the driver environments that are available and the versions that are available for each.

Environment

Available versions

"Windows NT x86"

1, 2, and 3

"Windows NT Alpha_AXP"

1 and 2

"Windows IA64"

3

"Windows NT R4000"

1

"Windows NT PowerPC"

1

"Windows 4.0"

0

-u   UserName   -w   Password   : Specifies an account with permissions to connect by using Windows Management Instrumentation (WMI) services to the computer from which you want to delete the driver. All members of the Administrators group for that computer have these permissions, but the permissions can also be granted to other users. If you do not specify an account, you must be logged on under an account with these permissions for the command to work. For more information on WMI, see Related Topics.

/? : Displays help at the command prompt.

Remarks

  • This command starts a script that is located in the systemroot\system32 directory. You must type this command at a command prompt with that directory as the current directory, or you must type the full path to that directory at the beginning of the cscript command.

  • When you delete a printer driver, you must include both the environment and the version parameters.

  • If the information that you supply contains spaces, use quotation marks around the text (for example, "Computer Name").

To list the printer drivers on a computer

Syntax

cscript prndrvr.vbs -l [-s RemoteComputer] [-u UserName -w Password]

Parameters

-l   : Required. Specifies that you want to list all the drivers on a computer.

-s   RemoteComputer   : Indicates the remote computer whose drivers you want to list. If you do not specify a computer, drivers on the local computer are listed.

-u   UserName   -w   Password   : Specifies an account with permissions to connect by using Windows Management Instrumentation (WMI) services to the computer whose drivers you want to list. All members of the Administrators group for that computer have these permissions, but the permissions can also be granted to other users. If you do not specify an account, you must be logged on under an account with these permissions for the command to work. For more information on WMI, see Related Topics.

/? : Displays help at the command prompt.

Remarks

  • This command starts a script that is located in the systemroot\system32 directory. You must type this command at a command prompt with that directory as the current directory, or you must type the full path to that directory at the beginning of the cscript command.

  • If the information that you supply contains spaces, use quotation marks around the text (for example, "Computer Name").

To delete all unused printer drivers from a computer

Syntax

cscript prndrvr.vbs -x [-s RemoteComputer] [-u UserName -w Password]

Parameters

-x   : Required. Specifies that you want to delete all unused printer drivers from a computer.

-s   RemoteComputer   : Specifies the remote computer from which you want to delete drivers. If you do not specify a computer, drivers are deleted from the local computer.

-u   UserName   -w   Password   : Specifies an account with permissions to connect by using Windows Management Instrumentation (WMI) services to the computer from which you want to delete drivers. All members of the Administrators group for that computer have these permissions, but the permissions can also be granted to other users. If you do not specify an account, you must be logged on under an account with these permissions for the command to work. For more information on WMI, see Related Topics.

/? : Displays help at the command prompt.

Remarks

  • This command starts a script that is located in the systemroot\system32 directory. You must type this command at a command prompt with that directory as the current directory, or you must type the full path to that directory at the beginning of the cscript command.

  • If the information that you supply contains spaces, use quotation marks around the text (for example, "Computer Name").

Formatting legend

Format

Meaning

Italic

Information that the user must supply

Bold

Elements that the user must type exactly as shown

Ellipsis (...)

Parameter that can be repeated several times in a command line

Between brackets ([])

Optional items

Between braces ({}); choices separated by pipe (|). Example: {even|odd}

Set of choices from which the user must choose only one

Courier font

Code or program output

Prncnfg.vbs

Prnjobs.vbs

Prnmngr.vbs

Prnport.vbs

Prnqctl.vbs

Command-line reference A-Z

WMI overview

WMI overview