add printer on windows 7 with vbscript and wmi
Posted
by Jessica
on Super User
See other posts from Super User
or by Jessica
Published on 2010-03-15T23:31:56Z
Indexed on
2010/03/15
23:40 UTC
Read the original article
Hit count: 412
I have a problem where I can't add a printer on my Windows 7 machine, because it fails with "The printer driver is unknown" (error code 1797) using WMI/VBScript.
The thing is that the printer driver already exists on the PC. I've used AddPrinterConnection to connect to the remote printer queue, and the drivers get installed. I've confirmed they exist by a) Enumerating Win32_PrinterDriver with WBEMTEST utility which shows the driver, and also in the Printer Management MMC snap-in.
Is there some other scriptable way I can get this to work? I'm adding a local TCP/IP port, pointing my new printer object instance to use that port and the driver from using AddPrinterConnection, and giving it a name, but it refuses to work...
© Super User or respective owner