Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Login script for TCP/IP networked printer

10 views
Skip to first unread message

Dan Williams

unread,
Oct 28, 2003, 6:17:33 AM10/28/03
to
Does anyone know if its possible to use a login script to connect users to a
printer via a print server and TCP/IP?

I've managed to successfully use con2prt.exe to connect users to shared
printers, but how do i connect them to networked printers?

All computers are Windows 2000 or XP Pro in an SBS 2000 domain. Is it
possible to setup certain computers with certain printers via the Active
directory and then whatever user logs into that computer, they'll
automatically have the corresponding printer available? Or is this something
a login script would need to do?

Many thanks

Dan Williams.


Matt Pollicove

unread,
Oct 28, 2003, 8:08:31 AM10/28/03
to
Yes it is possible. I assume you want to do this via WSH.

Sub SetPrinter
on error resume next
msgMSIE ("Configuring Printers.")
P1 = "\\PS546330\P1"
P2 = "\\PS546330\P2"
netobj.RemovePrinterConnection "LPT2"
errchk ("Clearing LPT2:")
netobj.RemovePrinterConnection "LPT3"
errchk ("Clearing LPT3:")
msgMSIE " "
netObj.AddPrinterConnection "LPT2", P1
errchk ("LPT2 is set to Laser Printer 1")
netObj.AddPrinterConnection "LPT3", P2
errchk ("LPT3 is set to Laser Printer 2")
msgMSIE "Setting default printer."
If PrinterFlag = 1 Then
netobj.SetDefaultPrinter "HP LaserJet 4 Plus (Left)"
errchk ("Your Default Printer is LPT2")
Elseif printerflag <> 1 Then
netobj.setdefaultprinter "HP LaserJet 4 Plus (Right)"
errchk ("Your Default Printer is LPT3")
End If
End Sub

I wrote this for a small office that had two workstations and two printers
off of a NETGEAR print server. Each computer has a default pritner assigned
to it. The script first clears any connections (helps prevent errors) and
then adds the printers held in P1 and P2. This should give you the help you
need. Please feel free to contact me should you need additional
information.

Matt
"Dan Williams" <dan_wi...@newcross-nursing.com> wrote in message
news:bnlj8d$ptm$1...@titan.btinternet.com...

Dan Williams

unread,
Oct 28, 2003, 11:04:03 AM10/28/03
to
This is where i'm getting confused. When a printer is setup on a print
server, what should the UNC path be?

Do i need to setup at least one computer with a standard TCP/IP local port
and then share it (seems a bit pointless, as it renders the print server
useless!) or do i need to configure local TCP/IP ports on every computer
that needs access to it? If so, is there a login script i can use to do it
for specific users and computers?

For example, we have a HP JetDirect 200m print server on IP address
192.168.0.20 and i've setup its hostname to equal JETDIRECT. Its name is
J6039B.

I've tried the following UNC paths but have so far not been able to connect
to it:-

\\192.168.0.20\hpofficejet
\\JETDIRECT\hpofficejet
\\J6039B\hpofficejet

The only way i've managed to get other computers to access it is by setting
up one computer with a local standard TCP/IP port and sharing it. If the
only other way is to setup each computer with local ports then i have to
ensure they have the correct drivers too!

Please help, i'm getting very confused!

Dan Williams.

"Matt Pollicove" <matt...@optonline.net> wrote in message
news:O0sqZSVn...@TK2MSFTNGP10.phx.gbl...

Matt Pollicove

unread,
Oct 28, 2003, 11:35:03 AM10/28/03
to
Don't know with the HP. I would suggest checking their techsupport site.
From my experience with the NETGEAR, it was referenced as
\\PRINTSERVER\PRINTER.

Good luck!

"Dan Williams" <dan_wi...@newcross-nursing.com> wrote in message

news:bnm41j$j05$1...@sparta.btinternet.com...

Patrick J. LoPresti

unread,
Oct 28, 2003, 12:04:58 PM10/28/03
to Dan Williams
First, read these:

http://support.microsoft.com/?kbid=189105
http://support.microsoft.com/?kbid=314486

It is pretty bad documentation, but you can probably find the
incantation you need by tweaking the examples.

For example, the following command works for me to install a direct
connection to an HP LaserJet 4050:

rundll32 printui.dll,PrintUIEntry /b "patlhack" /if /f %windir%\inf\ntprint.inf /r "http://laserjet.example.com/ipp" /m "HP LaserJet 4050 Series PS"

This creates a printer with a friendly name of "patlhack", using the
Windows network print driver (ntprint.inf), with a port name and
driver name suitable for my printer.

Modern HP printers support IPP (the Internet Printing Protocol) via
the URL <http://[printer]/ipp>, and that is what you should use if you
can. Try using the Add Printer Wizard and supplying a URL like
"http://jetdirect/ipp". If it works, then something like the command
above should do the trick for you. Otherwise, you will probably have
to use a port name like "IP_192.168.0.1" instead of the nice URL.

Either way, you must provide the driver name to the /m switch.

Good luck!

- Pat
http://unattended.sourceforge.net/

0 new messages