Try Microsoft Edge, a fast and secure browser that's designed for Windows 10 Get started

Microsoft
  • Store
    Store home
    Devices
    • Microsoft Surface
    • PCs & tablets
    • Xbox
    • Virtual reality
    • Accessories
    • Windows phone
    Software & Apps
    • Office
    • Windows
    • Additional software
    • Windows apps
    • Windows phone apps
    Games & Entertainment
    • PC games (disc)
    • Windows digital games
    • Windows phone games
    • Movies & TV
    • Music
    Deals
    • Sale
    • Microsoft Surface deals
    • PC deals
    • Xbox deals
    More
    • Business
    • Students & educators
    • Developer
    • Gift cards
  • Products
    Software & services
    • Windows
    • Office
    • Free downloads & security
    • Internet Explorer
    • Microsoft Edge
    • Skype
    • OneNote
    • OneDrive
    • Microsoft Health
    • MSN
    • Bing
    • Microsoft Groove
    • Microsoft Movies & TV
    Devices & Xbox
    • All Microsoft devices
    • Microsoft Surface
    • All Windows PCs & tablets
    • PC accessories
    • Xbox & games
    • Microsoft Lumia
    • All Windows phones
    • Microsoft HoloLens
    For business
    • Cloud Platform
    • Microsoft Azure
    • Microsoft Dynamics 365
    • Windows for business
    • Office for business
    • Skype for business
    • Surface for business
    • Enterprise solutions
    • Small business solutions
    • Find a solutions provider
    • Volume licensing
    For developers & IT pros
    • Develop Windows apps
    • Microsoft Azure
    • MSDN
    • TechNet
    • Visual Studio
    For students & educators
    • Office for students
    • OneNote in classroom
    • Shop PCs & tablets perfect for students
    • Microsoft in Education
  • Support
Sign in
  • items in cart
items in cart

 Manage my account
 Manage my account
 Ask the community
 Contact us
 Find downloads

CV: TpBhBIZsWoeC01R8.0

How to add printers with no user interaction in Windows

  •  Email
  •  Print

For a Microsoft Windows XP version of this article, see 314486 .

Summary

Windows 2000 and Windows Server 2003 provide the ability to install a printer using a command line. This is particularly useful when you add or remove a printer from a group of users using a login script or a scheduled event.

Although Microsoft Windows NT 4.0 Zero Administration Kit (ZAK) contains tools such as Con2prt.exe, the Con2prt.exe tool provides the ability to add or delete only network printers. You can also modify and delete local printers using Windows 2000. The result is that an administrator can control all aspects of a user's ability to print by having users run a batch file or logon script.

NOTE: Using this command in a login script or a client-launched batch file requires the client computer to be running Windows 2000 or Windows Server 2003. Because the login script runs on the client computer, a Windows NT 4.0 client is unable to process the command.

In addition, these commands can be run from an administrator's workstation or from a server so that the printers are push-installed to the client computers without having to go to the actual computer.

More Information

The following examples list the most typical uses for the command.

NOTE: This command only runs on a Windows 2000-based or Windows Server 2003-based computer against a Windows 2000, Windows Server 2003, or a Windows NT 4.0 server or workstation.

This example adds an Agfa printer driver and creates a logical printer on a computer named SERVER.

NOTE: Both lines can be placed in a batch file or typed after each other at a command prompt. These two lines are wrapped for readability.
rundll32 printui.dll,PrintUIEntry /ia /c\\server /m "AGFA-AccuSet v52.3" /h "Intel" /v "Windows 2000" /f %windir%\inf\ntprint.inf


rundll32 printui.dll,PrintUIEntry /if /b "Test Printer" /c\\SERVER /f "%windir%\inf\ntprint.inf" /r "lpt1:" /m "AGFA-AccuSet v52.3"
This example deletes an AGFA printer on a computer named SERVER:
rundll32 printui.dll,PrintUIEntry /dl /n "Test Printer" /c\\SERVER
For more information about the available switches, type
/? after the command.

In addition, at a command prompt, type:
rundll32 printui.dll,PrintUIEntry /?
The preceding command displays the entire list of usage switches with extensive examples for using this method.

Additionally, at a command prompt, type
rundll32 printui.dll,PrintUIEntry /Xs /n "printer" ?
The preceding command displays additional help for changing printer properties. The following example switches the current print driver to the specified new printer driver (already installed on the server):
rundll32 printui.dll,PrintUIEntry /Xs /n\\SERVER\PRINTERSHARENAME DriverName "Lexmark C752 PS3"


NOTE: The following syntax is an example that works correctly as long as the Standard TCP/IP Ports are created.
rundll32 printui.dll,PrintUIEntry /if /b "NORTH-US-SRTEST-TEST24-BOGUS" /f %windir%\inf\ntprint.inf /r "IP_157.57.50.98" /m "HP Laserjet 4000 Series PCL" /Z
If Standard TCP/IP Ports are not created, the following error dialog box may be experienced:
Printer User Interface
Printer rundll command failed.
Command: /if /b "NORTH-US-SRTEST-TEST24-BOGUS" /f %windir%\inf\ntprint.inf /r "IP_157.57.50.98" /m "HP Laserjet 4000 Series PCL" /Z.
You either entered a printer name that was incorrect or the specified printer is no longer connected to the server. Click Help for more information.
Properties

Article ID: 189105 - Last Review: Jan 7, 2008 - Revision: 1

Feedback
Thanks! Your feedback will help us improve the support experience.

Support

Support

  • Account support
  • Supported products list
  • Microsoft Lifecycle Policy

Security

Security

  • Safety & Security Center
  • Download Security Essentials
  • Malicious Software Removal Tool

Contact Us

Contact Us

  • Report a support scam
  • Disability Answer Desk
  • Locate Microsoft addresses worldwide
This site in other countries/regions
Algérie - Français
Argentina - Español
Australia - English
Belgique - Français
België - Nederlands
Bolivia - Español
Bosna i Hercegovina - Hrvatski
Brasil - Português
Canada - English
Canada - Français
Chile - Español
Colombia - Español
Costa Rica - Español
Crna Gora - Srpski
Danmark - Dansk
Deutschland - Deutsch
Dominican Republic - Español
Ecuador - Español
Eesti - Eesti
El Salvador - Español
España - Español
Estados Unidos - Español
France - Français
Guatemala - Español
Hong Kong SAR - English
Hrvatska - Hrvatski
India - English
Indonesia (Bahasa) - Bahasa
Ireland - English
Italia - Italiano
Latvija - Latviešu
Lietuva - Lietuvių
Luxembourg - Français
Magyarország - Magyar
Malaysia - English
Maroc - Français
México - Español
Nederland - Nederlands
New Zealand - English
Norge - Bokmål
Panamá - Español
Paraguay - Español
Perú - Español
Philippines - English
Polska - Polski
Portugal - Português
Puerto Rico - Español
România - Română
Schweiz - Deutsch
Singapore - English
Slovenija - Slovenščina
Slovensko - Slovenčina
South Africa - English
Srbija - Srpski
Suisse - Français
Suomi - Suomi
Sverige - Svenska
Tunisie - Français
Türkiye - Türkçe
United Kingdom - English
United States - English
Uruguay - Español
Venezuela - Español
Việt Nam - Tiếng việt
Ísland - Íslenska
Österreich - Deutsch
Česká Republika - Čeština
Ελλάδα - Ελληνικά
България - Български
Казахстан - Русский
Россия - Русский
Україна - Українська
ישראל - עברית
الإمارات العربية المتحدة - العربية
المملكة العربية السعودية - العربية
مصر - العربية
भारत - हिंदी
ไทย - ไทย
中国 - 简体中文
台灣 - 繁體中文
日本 - 日本語
香港特別行政區 - 繁體中文
대한민국 - 한국어
Algérie - Français
Estados Unidos - Español
Perú - Español
Việt Nam - Tiếng việt
Argentina - Español
France - Français
Philippines - English
Ísland - Íslenska
Australia - English
Guatemala - Español
Polska - Polski
Österreich - Deutsch
Belgique - Français
Hong Kong SAR - English
Portugal - Português
Česká Republika - Čeština
België - Nederlands
Hrvatska - Hrvatski
Puerto Rico - Español
Ελλάδα - Ελληνικά
Bolivia - Español
India - English
România - Română
България - Български
Bosna i Hercegovina - Hrvatski
Indonesia (Bahasa) - Bahasa
Schweiz - Deutsch
Казахстан - Русский
Brasil - Português
Ireland - English
Singapore - English
Россия - Русский
Canada - English
Italia - Italiano
Slovenija - Slovenščina
Україна - Українська
Canada - Français
Latvija - Latviešu
Slovensko - Slovenčina
ישראל - עברית
Chile - Español
Lietuva - Lietuvių
South Africa - English
الإمارات العربية المتحدة - العربية
Colombia - Español
Luxembourg - Français
Srbija - Srpski
المملكة العربية السعودية - العربية
Costa Rica - Español
Magyarország - Magyar
Suisse - Français
مصر - العربية
Crna Gora - Srpski
Malaysia - English
Suomi - Suomi
भारत - हिंदी
Danmark - Dansk
Maroc - Français
Sverige - Svenska
ไทย - ไทย
Deutschland - Deutsch
México - Español
Tunisie - Français
中国 - 简体中文
Dominican Republic - Español
Nederland - Nederlands
Türkiye - Türkçe
台灣 - 繁體中文
Ecuador - Español
New Zealand - English
United Kingdom - English
日本 - 日本語
Eesti - Eesti
Norge - Bokmål
United States - English
香港特別行政區 - 繁體中文
El Salvador - Español
Panamá - Español
Uruguay - Español
대한민국 - 한국어
España - Español
Paraguay - Español
Venezuela - Español
  • English (United States)‎
  • Terms of use
  • Privacy & cookies
  • Trademarks
  • © 2017 Microsoft