Installing Canon Printer via VBScript/CMD

1

I am trying to write a VBScript that installs a Canon LBP6780 Printer via IP address automatically when clicked.

I have a more complex script but the part I am having trouble with is the following line of code... although it is called from a VBS file, it's actually running a bit of cmd prompt code.

cmd /c rundll32 printui.dll,PrintUIEntry /if /b "Store Printer" /f "CNLB0KA64.INF" /r "IP_10.17.9.50" /m "Canon iR 6870C EUR" /Z

To put it into better context, "Store Printer" is the new name of the printer i'm trying to add, "CNLB0KA64.INF" is the path to the driver file, "IP_10.17.9.50" is the IP address of the printer and "Canon iR 6870C EUR" is the name of the driver I want to use - it isn't the same driver as the printer but when manually adding the printer outside of code, this driver works.

I get this error code0x00000002 when trying to run it.

Traditionally I have used the HP Laserjet 4100 Drivers as these are so generic that they work with a lot of printers but they don't seem to work with these printers. I don't get the error but it also doesn't print.

Anyone have any ideas?

batch-file
printing
vbscript
cmd
asked on Stack Overflow Nov 5, 2015 by Dan Wheeler • edited Aug 13, 2019 by Gerard Roche

0 Answers

Nobody has answered this question yet.


User contributions licensed under CC BY-SA 3.0