01-27-2014 05:57 AM
Hi, I am trying to install HP Universal Printing PCl 6 printers on a local machine using a batchfile from an application (C#) which automatically detects if a printer has been installed or not. The batchfile has the following entries:
set IP=IP_%1 pushd "%windir%\System32\Printing_Admin_Scripts\en
-US\ Cscript Prnport.vbs -a -r IP -h %1 rundll32 printui.dll,PrintUIEntry /ia /m "HP Unive rsal Printing PCl 6" /h "x64" /v "Type 3" /f %wind ir%\inf\ntprint.inf /u rundll32 printui.dll,PrintUIEntry /if /b %1 /f "%w indir%\inf\ntprint.inf" /r IP /m "HP Universal Pri nting PCl 6"
When I run my application, the printer is installed but when I try to print, sometimes I get the HP Universal Printing dialog asking me to select a printer. I can't even exit from this dialog. Other times when I dont get the printing dialog my print function fails with Invalid Handle exception.
The next time I try to print with the printer installed, it prints documents successfully.
How can I disable this print dialog using the batchfile above and why do I get the Invalid Handle expection on the first install and print??