Jump to content

Recommended Posts

Posted (edited)

Good Afternoon

 

I have used vb scripts for everyjob i have done in schools and in the nhs, i came to this school and now im having so much issues with vb scripts.

 

This is the script i'm using

 

Set WshNetwork = CreateObject("WScript.Network")
PrinterPath = "\\SERVERNAME\Sharp_MXM450N"
PrinterDriver = "Sharp_MXM450N"
WshNetwork.AddWindowsPrinterConnection PrinterPath, PrinterDriver
WshNetwork.SetDefaultPrinter "\\SERVERNAME\Sharp_MXM450N"

 

this has worked for all printer in the school except HP prints. Im so confused why it will not work with HP printings.

 

This is the error i got

 

error.jpg

 

Can anyone help me out here!

 

Thank you

 

Ryan

Edited by Ryan233
Posted
I discovered in the past that the HP printer drivers are very picky about the names. Take alook in the inf file to see what the driver is actually being called or try the HP universal driver if it will support the printers you have. I had a hell of a job with the HP printers and once I got it working I didn't ever try an update of the driver just in case it broke it all again ;-)
Posted
I discovered in the past that the HP printer drivers are very picky about the names. Take alook in the inf file to see what the driver is actually being called or try the HP universal driver if it will support the printers you have. I had a hell of a job with the HP printers and once I got it working I didn't ever try an update of the driver just in case it broke it all again ;-)

 

I will have a look at this nd get back to you

Posted

Well i tried using the suggests above and none of them worked for the HP Printers

 

i tried using WNet.AddWindowsPrinterConnection PrinterPath instead and believe it or not it came up with the following error

 

error.jpg

 

I have tried installing different drivers and universal drivers, with no luck

Posted

ive never had to specify the driver for a printer before i just use the following

 

' suiteprinters.vbs - Jonathan
Option Explicit
Dim objNetwork
on error resume next
Set objNetwork = CreateObject("WScript.Network") 

objNetwork.AddWindowsPrinterConnection "\\server\libbw01"

objNetwork.SetDefaultPrinter "\\server\libbw01"

 

i have found though that if your share name and printer naem are eifferent it can cause some issues on win7 (so printer is shared as say \\server\printer1 but its named suite1 printer)

Posted (edited)

Well we have three HP printers.

 

The main ones are a HP2550n and im using the HP universal Printing driver.

 

Now When i have just tried to connect to this printer is saying it cannot find the correctly driver so it looks like its something to with the driver installed.

 

PS i have just tried to installed the HP laserjet 2550n pcl6 driver but i still get the same thing

 

Error1.jpg

 

Any help would be greatly appreciated

Edited by Ryan233
Posted
Sure you're specifying the correct driver (as found in the test page) ?

 

eg PrinterDriver = "HPZ2KU09.DLL" for instance

 

Yeah i tried the following

 

Drivername = UNIDRV.DLL and ICTcolour.

 

None of these has worked

Posted

so to confirm, you have a number of printers

 

you give them an IP address and installed them on the server and then share on the server giving them a unique name each.

 

what happens if you simply go to the \\servername and then double click on the printer to install it??

Posted
so to confirm, you have a number of printers

 

you give them an IP address and installed them on the server and then share on the server giving them a unique name each.

 

what happens if you simply go to the \\servername and then double click on the printer to install it??

 

Like i mentioned above it tries to connect to the windows update to download a driver. it comes back with no driver recognized

 

Then it basically says you can manually select a drivers INF file or cancel.

 

Error1.jpg

 

I think this is the issue but i have tried three different drivers now and none of them work. btw if i try to manually attach the pcl6 driver to this printer it comes with another error saying Windows cannot connect to the printer but users can browse the network find the printer an print.

Posted (edited)
have you checked the share levels on the srever and who is able to get to the shared driver on the server

 

I have just looked at this and there seems to be fine with permissions. This issue is starting to really annoy me haha

 

I have just tried to connect to all the HP printers and all of them search for the driver

Edited by Ryan233

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now



×
×
  • Create New...