Discussion Locked

Mapping a networked printer

0 helpful
3 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

Hi all.

I just added a color laser printer to a Win2000 Server/Domain and is set as shared.

I added a line to the login script
"net use lpt1: \\server\printername"

The problem is that the printer does not show up in the client (all WinXP Pro machines). I can print using a DOS command "dir > lpt1:", however, if I use the control panel to see all the printers, it does not show. So the user does not even know it is there.

Any ideas/suggestions how to do this?

Thanks

Nate

3 replies

by onalos

Try this:

' VBScript.
Dim net
Set net = CreateObject("WScript.Network")
net.AddWindowsPrinterConnection "\\ServerName\PrinterName"

Copy and paste the example above (or below) into notepad.exe

IMPORTANT change the variable ServerName toa computer on your network.

Change the PrinterName to the name of a real printer.

Save the script with a .vbs extension, and double click the file to test it.

You should be able to use this in your logon script. If not then all you haveto do is have the user double click it and theres nothing they need to do. It takes about a second. Here is another piece of code to make a printer a default printer.

' VBScript.
Dim net
Set net = CreateObject("WScript.Network")
net.SetDefaultPrinter "\\ServerName\PrinterName"

onalos

This discussion is closed to new replies.