Prndrvr.vbs

Applies To: Windows Server 2003, Windows Server 2003 R2, Windows Server 2003 with SP1, Windows Server 2003 with SP2

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

  • To delete a printer driver

  • To list the printer drivers on a computer

  • To delete all unused printer drivers from a computer

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, Windows 2000, and the Windows Server 2003 family.

  • -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.
<table>
<colgroup>
<col style="width: 50%" />
<col style="width: 50%" />
</colgroup>
<thead>
<tr class="header">
<th>Environment</th>
<th>Available versions</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td><p><strong>&quot;Windows NT x86&quot;</strong></p></td>
<td><p>1, 2, and 3</p></td>
</tr>
<tr class="even">
<td><p><strong>&quot;Windows NT Alpha_AXP&quot;</strong></p></td>
<td><p>1 and 2</p></td>
</tr>
<tr class="odd">
<td><p><strong>&quot;Windows IA64&quot;</strong></p></td>
<td><p>3</p></td>
</tr>
<tr class="even">
<td><p><strong>&quot;Windows NT R4000&quot;</strong></p></td>
<td><p>1</p></td>
</tr>
<tr class="odd">
<td><p><strong>&quot;Windows NT PowerPC&quot;</strong></p></td>
<td><p>1</p></td>
</tr>
<tr class="even">
<td><p><strong>&quot;Windows 4.0&quot;</strong></p></td>
<td><p>0</p></td>
</tr>
</tbody>
</table>
  • -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").

Examples

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.
<table>
<colgroup>
<col style="width: 50%" />
<col style="width: 50%" />
</colgroup>
<thead>
<tr class="header">
<th>Environment</th>
<th>Available versions</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td><p><strong>&quot;Windows NT x86&quot;</strong></p></td>
<td><p>1, 2, and 3</p></td>
</tr>
<tr class="even">
<td><p><strong>&quot;Windows NT Alpha_AXP&quot;</strong></p></td>
<td><p>1 and 2</p></td>
</tr>
<tr class="odd">
<td><p><strong>&quot;Windows IA64&quot;</strong></p></td>
<td><p>3</p></td>
</tr>
<tr class="even">
<td><p><strong>&quot;Windows NT R4000&quot;</strong></p></td>
<td><p>1</p></td>
</tr>
<tr class="odd">
<td><p><strong>&quot;Windows NT PowerPC&quot;</strong></p></td>
<td><p>1</p></td>
</tr>
<tr class="even">
<td><p><strong>&quot;Windows 4.0&quot;</strong></p></td>
<td><p>0</p></td>
</tr>
</tbody>
</table>
  • -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 [-sRemoteComputer] [-uUserName-wPassword]

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.
This parameter deletes printer drivers that are installed for clients running other versions of Windows. The Fax component might require these drivers when it is used as a fax server for computers running Windows 95, Windows 98, Windows Millennium Edition, and Windows NT 4.0 client computers. This parameter also deletes the primary fax driver if it is not in use. If you delete a driver that is being used by the Fax component, you must reinstall the fax component or it will not function correctly.
  • -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

See Also

Concepts

Prncnfg.vbs
Prnjobs.vbs
Prnmngr.vbs
Prnport.vbs
Prnqctl.vbs
Command-line reference A-Z
Command shell overview
Windows Management Instrumentation Command-line overview
Windows Management Instrumentation Command-line