Subscribe to Windows IT Pro
July 30, 2003 12:00 AM

Predefine Printers for Computer Lab Users

Windows IT Pro
InstantDoc ID #39421
Rating: (4)

In a computer lab that different people use every day, you need to define the network printers for everyone by default. Windows 2000 lets an administrator easily configure a locally attached printer, which then automatically appears in the printer list for all system users. Configuring a network printer presents more of a challenge.

Many administrators use logon scripts to define the appropriate printers on a system for users. However, you can use a one-time operation that doesn't require logon scripts to complete this task.

Go to a command prompt and enter

rundll32.exe printui.dll,PrintUIEntry <options>

The name of the entry point is case sensitive.

The /? option will give you a list of all the other options. The option you'll probably use most often is /ga /n\\server\printer. This command globally adds a printer that points to a print server queue.

To run the command remotely, simply add /c\\computername. You can combine these commands to easily set up an entire lab of computers in just a few minutes. To point to the lab's printer, use a list of commands such as

rundll32.exe printui.dll,
PrintUIEntry /ga /n\server\labprinter /c\labcomputer1

The next time a user logs on to the machine, the printer will automatically appear in the user's list of defined printers and in the Settings, Printers window. A limitation is that the command is computer-specific; if the user moves to another computer, the printer will no longer appear. If you add more than one printer, the first printer in the alphabetical list will be the user's default printer unless the user overrides it.

To check existing settings, use the command /ge. To delete settings, use /gd. The Microsoft Windows 2000 Server Resource Kit only briefly mentions this printing system management interface. In addition, the program has only one Help screen (i.e., Documentation). Experiment with the command to determine how to use it to meet your needs. The command works equally well for lab computers and in an office environment in which users occasionally share computers.

Related Content:

ARTICLE TOOLS

Comments
  • Anonymous User
    7 years ago
    Mar 12, 2005

    Does this work with server 2003 using batch file scripts.

  • Anonymous User
    7 years ago
    Mar 07, 2005

    'However, how do you remotely install JetDirect or "Standard TCP/IP Printers?"'

    In the options, you can specify the port. I have used this before, but haven't reviewed the options in detail yet:

    rundll32 printui.dll,PrintUIEntry /b "HP Laserjet 4100" /if /f %windir%\\inf\\ntprint.inf /r "IP_192.168.1.7" /m "HP LaserJet 4100 Series PCL"

    You may have to first create that IP port. There are vb scripts around that do it. I used this:

    Set objWMIService = GetObject("winmgmts:")
    Set objNewPort = objWMIService.Get _
    ("Win32_TCPIPPrinterPort").SpawnInstance_
    objNewPort.Name = "IP_192.168.1.7"
    objNewPort.Protocol = 1
    objNewPort.HostAddress = "192.168.1.7"
    objNewPort.PortNumber = "9100"
    objNewPort.SNMPEnabled = False
    objNewPort.Description = "hp4100.frentic.lan"
    objNewPort.Put_

  • Paul
    7 years ago
    Feb 14, 2005

    Will this work for IP Printers as well?

  • ROBERT
    7 years ago
    Feb 04, 2005

    I found this article to be a lifesaver for remotely installing windows shared printers, ie the \\\\ServerName\\ShareName variety.

    However, how do you remotely install JetDirect or "Standard TCP/IP Printers?"

  • Anonymous User
    8 years ago
    Nov 09, 2004

    using vbscript I can not setup printers link /ga option of this command line! Do you know how?

You must log on before posting a comment.

Are you a new visitor? Register Here

advertisement

advertisement

Windows is a trademark of the Microsoft group of companies. Windows IT Pro is used by Penton Media Inc. under license from owner.