2

I am trying to add a network printer via batch file, provided I feed the data(Printer IP, Printer Name, Computer IP) into the entries.

rundll32 printui.dll,PrintUIEntry /if /b "KONICA MINOLTA C451 PS(P)" /c\\%computerNameIP% /h "x86" /f %windir%\inf\prnkm002.inf /r "IP_%computerNameIP%" /m "KONICA MINOLTA C451 PS(P)" /n\\%computerNameIP%\%printerName%   /F %windir%\inf\prnkm002.inf

Now, once this command is completed, I receive the following error:

Operation could not be completed(error 0x00000032). This operation is not supported.

I ran a similar code with runs the GUI:

rundll32 printui.dll,PrintUIEntry /il /b "KONICA MINOLTA C451 PS(P)" /c\\%computerNameIP% /h "x86" /f %windir%\inf\prnkm002.inf /r "IP_%computerNameIP%" /m "KONICA MINOLTA C451 PS(P)" /n\\%computerNameIP% \%printerName%   /F %windir%\inf\prnkm002.inf

and I have to choose a local local Printer: which I adjust to be TCP/IP and the drivers come default since I set it. After choosing my driver, I receive the error as well.

I just can't pinpoint what exactly isn't supported.

Windows 7 32-bit. I made adjustments to the registry, print management, group policy, but none of those seem concrete to what is preventing a remote add to a network printer.

  • What is `\%printerName%`? Is that supposed to be part of `/n`? Can you post the entire batch file? or at least the variable declarations? –  Oct 04 '16 at 18:52
  • %printerName% - declares what the displayed printer name is. When I have been testing it, I just give it the same exact name as the model, to make sure there isn't any issues with the naming scheme. – Matt Pielichowski Oct 04 '16 at 19:14
  • My point is that it's kind of just hanging there. `/n\\%computerNameIP% ^ \%printerName`. If you're trying to *name* it "\\192.168.1.50\Printer01" then it should be `/n \\%computerNameIP%\%printerName%` –  Oct 04 '16 at 19:28
  • https://www.scribd.com/document/326412219/Printer-Test - Batch file. I am specifically doing just: IP of printer, Y, Y, Name I give printer, IP of computer. – Matt Pielichowski Oct 04 '16 at 19:31
  • My bad, I added a bunch of ^ to make the code viewable up above. I'll adjust the doc. – Matt Pielichowski Oct 04 '16 at 19:39
  • The code is how you wrote it, I just adjusted it to make it look nicer on this website. The actual code does not have the ^ in it. – Matt Pielichowski Oct 04 '16 at 19:55
  • I see 3 variants of the command in the bat file, are any of them successful? –  Oct 04 '16 at 19:56
  • Everything is run local in the other parts. I don't run it, since I still have to edit that code- but its safe to say it isn't run. – Matt Pielichowski Oct 04 '16 at 20:36
  • If the printer name has spaces you'll need to change the `/n` parameters to `/n "\\%computerNameIP%\%printerName%"` –  Oct 04 '16 at 20:42
  • I've been naming them test_print1....test_print20 – Matt Pielichowski Oct 04 '16 at 20:56
  • Any thoughts @Scott – Matt Pielichowski Oct 07 '16 at 15:26
  • No, sorry. It's almost impossible to duplicate without a network printer and valid INF file. I tried a few things including generic printers and my PDF writer but the command always said it couldn't find an appropriate driver. Sorry. –  Oct 07 '16 at 15:38

1 Answers1

0

I found another way to do it with the prncnfg.vbs files. First create the port, assign it, then manage it.

This is all located in the admin scripts in Windows folder