We help IT Professionals succeed at work.

TCP/IP Printer install via VBScript

I have several printers I need to install throughout the network.  I would like to accomplish this through a vbscript.   The printers are TCP/IP.  How would I go about scripting the install of a TCP/IP printer on the network.

The printers do show up in Active Directory if that helps.
Comment
Watch Question

Top Expert 2005
Commented:
You're running Server 2008, as long as the client is XP with the group ploicy preferences patch or Vista or newer, you can use Group Policy Preferences or Print Management Console to deploy your printers via Group Policy.It's the easiest method and ensures they  get done.
brwwigginsIT Manager

Commented:
I agree the GPO preferences are easier, but if you insist on VBS then you could do something similar to below
Option Explicit
Dim mappedPrinter, printerpath
printerpath = "\\Server\PrinterName" 
Set mappedPrinter = CreateObject("WScript.Network") 
mappedPrinter.AddWindowsPrinterConnection printerpath

Open in new window

Author

Commented:
I did not know there was a preference patch for XP?  There is really?  We are using Server 2008 and Windows XP SP3 clients.  Do all the preferences apply to XP or just certain ones?
Top Expert 2005

Commented:
This is the patch you need:

http://www.microsoft.com/downloads/details.aspx?FamilyID=e60b5c8f-d7dc-4b27-a261-247ce3f6c4f8&displaylang=en

It might have already been deployed via Automatic Updates.  You can easily check this by looking for the KB number in the registry here:

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Updates\Windows XP\SP20