Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

Connect and Set printer default

Posted on 2006-05-02
10
Medium Priority
?
474 Views
Last Modified: 2012-05-05
I'm trying to connect to a printer that is connected to the network via external Lexmark print server.  I've been unable to find the "XXXXXX" components for the script shown below:

Set WshNetwork = CreateObject("WScript.Network")
PrinterPath = "\\xxxxxx\xxxx"
PrinterDriver = "Lexmark Optra E310"
WshNetwork.AddWindowsPrinterConnection PrinterPath, PrinterDriver
WshNetwork.SetDefaultPrinter "\\\xxxxxx\xxxxxxx"

I have the config printout from the server.

Can someone please help....before I get "userabused".
Thanks  
0
Comment
Question by:wshepard
  • 5
  • 3
  • 2
10 Comments
 
LVL 5

Expert Comment

by:The_IT_Garage
ID: 16588128
Assuming you're using TCP/IP throughout:

It looks like you're trying to connect via UNC shares where the script is expecting the printer to be shared from a server or PC and thus is looking for \\ServerName\PrinterShareName.

If you create a port on a server and *then* share the printer you can then fill in the X's with the data above where ServerName is the name of the server or PC you've created the printer on. If you need more detail or my assumptions are incorrect please let me know.

Is the network peer-to-peer or do you have a server? How many machines will be printing to the printer and what OS's are involved?
0
 

Author Comment

by:wshepard
ID: 16588165
Domain
Printer is not connected to a PC.  Connected directly to the network via external print server. (Lexmark Marknet X2011e).
250+
W2k
0
 

Author Comment

by:wshepard
ID: 16588235
IT Garage,

Domain
Printer is not connected to a PC.  Connected directly to the network via external print server. (Lexmark Marknet X2011e).
250+
W2k

All TCP/IP

I can ping the server via IP address and hostname (LXK3C2327) but I'm not sure how to use those in place of the unc.
0
[Webinar On Demand] Database Backup and Recovery

Does your company store data on premises, off site, in the cloud, or a combination of these? If you answered “yes”, you need a data backup recovery plan that fits each and every platform. Watch now as as Percona teaches us how to build agile data backup recovery plan.

 
LVL 4

Expert Comment

by:triceice
ID: 16588272
You can use the IP in UNC shares. So if you have an IP for it put that in place of the name. Example \\192.168.0.99\Printername
0
 

Author Comment

by:wshepard
ID: 16588441
I setup the printer using "Add Printer Wizard".  Now all I need to do is make it the default.  I tried using

Set Net = CreateObject("WScript.Network")
Net.SetDefaultPrinter "\\10.10.5.128\Lexmark Optra E310"

But get an error that says "There is no printer called "\\10.10.5.128\Lexmark Optra E310"
Error Code 80020009

0
 

Author Comment

by:wshepard
ID: 16588517
This worked where the printer is already added on a machine.

Dim Net
Set Net = WScript.CreateObject("WScript.Network")
Net.SetDefaultPrinter "Computer Room"
Set Net = Nothing
0
 
LVL 4

Expert Comment

by:triceice
ID: 16588552
Before you continue working on the script verify that you can at least manually connect to it by going through the add printer wizard on a desktop. Also check to make sure that is the correct name for the printer and that it's not something like \\10.10.5.128\Lemark_Optra_E310\ because the printer server may not have the same name as you think.
0
 
LVL 5

Expert Comment

by:The_IT_Garage
ID: 16588786
I understand the printer is not directly connected to any machine :-).

You create a TCP/IP printer port on the server pointing to the Lexmark's IP, this is how it is usually done - a server can have dozens of printers attached to one server in this manner. You then create the printer share, then you can add this printer to machines via login script as well as set it as the default if desired. the command in the login script would be simply:

rundll32 printui.dll PrintUIEntry /in /n /y \\machine\printer (remove /y if you don't want it as default)

250 machines will print to this Lexmark...does your server have *any* printers installed and shared out or is the the first network printer?

Alternately, for you "Net.SetDefaultPrinter "\\10.10.5.128\LexmarkOptraE310" raname it with no spaces and try it that way.
0
 

Author Comment

by:wshepard
ID: 16588865
IT Garage,

And if the printer is not shared from a PC server?
0
 
LVL 5

Accepted Solution

by:
The_IT_Garage earned 1500 total points
ID: 16589519
Good question! We have never deployed printers like that but I know others have.

Microsoft's PrintUI guide is a Word doc linked from here:
http://tinyurl.com/papc2

Also from this link: http://support.microsoft.com/kb/189105/EN-US/

Towards the bottom it looks like this sample is your answer:
"rundll32 printui.dll,PrintUIEntry /if /b "NORTH-US-SRTEST-TEST24-BOGUS" /f %windir%\inf\ntprint.inf /r "IP_157.57.50.98" /m "HP Laserjet 4000 Series PCL" /Z "

Also Googling "printUI IP printer" will return numerous links as well. Or with any luck someone who has done exactly what you're doing will chime in, as all the networked printers we've done have been server-based so my previous posts' example was what we use.
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

NTFS file system has been developed by Microsoft that is widely used by Windows NT operating system and its advanced versions. It is the mostly used over FAT file system as it provides superior features like reliability, security, storage, efficienc…
Often, the users face difficulty in accessing Outlook 2016 PST files on Windows 10 computer. One of the reasons behind it is the improper functioning of MS Outlook when the user tries to open it. MS Outlook suddenly stops working, or it will not op…
This video shows how to quickly and easily deploy an email signature for all users in Office 365 and prevent it from being added to replies and forwards. (the resulting signature is applied on the server level in Exchange Online) The email signat…
This lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …

578 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question