Skip to main content

Scripted TCP/IP printer installation

More
16 years 2 months ago #25220 by skepticals
Is there a way to script the installation of a local TCP/IP printer? One that doesn't use a print server.

I would need the script to configure the printer settings too. IE, default Black and White, paper size, etc.

Is this possible? Are these settings stored in the Windows registry and can be exported?

Thoughts?
More
16 years 2 months ago #25225 by jtartist
I use prnport.vbs to create the port and then printui.dll to install the printer drivers and map the printer to the new port. I'm not sure if you can set the additional features this way though. I can post an example tomorrow if you'd like.

JT
More
16 years 2 months ago #25228 by SteveP
@jtartist: An example would be very useful. I'm collecting useful "snippets" and I think that this is a candidate for my file!
More
16 years 2 months ago #25235 by jtartist
1.

cscript c:\windows\system32\prnport.vbs -t -r specifyportname -o raw -n 9100 -h specifyportname


Change these fields:

specifyportname = enter IP address or hostname

specifyportname = enter the same thing again.



2.

rundll32 printui.dll,PrintUIEntry /if /b "EnterPrinterName" /f c:\lj4100\hp4100p6.inf /r "specifyportname" /m "HP LaserJet 4100 PCL 6"



Change these fields:

EnterPrintername = this names the printer (do not remove quotes)


Specifyportname = use same port name specified in step one.



c:\lj4100\hp4100p6.inf = this tells the script where to locate the printer drives. I use Altiris to copy the printer drivers to the local computer "before" I run the script.


"HP LaserJet 4100 PCL 6" = this field is located in the above .inf file, and specifies which printer driver you want to install.


Hopefully it makes sense posted this way. Let me know if you have any Q's.

-JT
More
16 years 2 months ago #25236 by SteveP
That's great jtartist - I'll have a "play". I'm not familiar with Altiris so I'd better do some googling!
Time to create page: 0.136 seconds