PDA

View Full Version : Printer Driver is Unknown



joe_gan
01-21-2002, 11:18 AM
Hi,

I wonder why this code produce "Printer Driver is Unknown"

Set WshNetwork = WScript.CreateObject("WScript.Network")
PrinterPath = "\Poaabc01\prnne04"
PrinterDriver = "HP LaserJet 5P/5MP PostScript"
WshNetwork.AddWindowsPrinterConnection PrinterPath, PrinterDriver

Check on the document, it say the printer driver must be installed first. I checked and found the driver is in my Printer Driver List, but still the system unrecognize it. It is OK if I manually add one network printer with the said printer driver before run the above script.

Can any one guide me?

Regards
Joe

khumphries
01-22-2002, 01:29 PM
Try reversing PrinterPath and PrinterDriver.

WshNetwork.AddWindowsPrinterConnection PrinterDriver, PrinterPath

Its looking at the PrinterPath as the driver. Hope this helps.