We help IT Professionals succeed at work.

using  rundll32 printui  printuientry

Medium Priority
59 Views
Last Modified: 2020-02-19
using  rundll32 printui  printuientry

I have csv file that has a list of computers. I would like to run the command  rundll32 printui  printuientry  against each computer on the list and install printer .

Any Help on achieving that ?

Thanks
Comment
Watch Question

CERTIFIED EXPERT

Commented:
for /f %i in (computer.csv) do rundll32 printui.dll,PrintUIEntry /ga /c%i /n\\SERVER\printer

Open in new window


But if you're in a Windows domain I'd rather use Group Policy Preferences or maybe a logon script.
https://deployhappiness.com/deploying-printers-with-group-policy-preferences/

Author

Commented:
It is not windows domain unfortunately...targeted computers are in work group. they are thin client
by the way can you add username and password to the script, as  the workstation i logon and run the script is domain member
CERTIFIED EXPERT
Commented:
Put it in a Batch script:

set /p U="Enter username: " 
set /p P="Enter password: "
for /f %%i in (computer.csv) do Call :ConnPrinter %%i
goto :EOF
:ConnPrinter
net use \\%1 /user:%U% %P% /persistent:no
rundll32 printui.dll,PrintUIEntry /ga /c%1 /n\\SERVER\Printer
net use \\%1/del

Open in new window

Author

Commented:
Michael Pfister

can you explain your Code, please?

if I understand your script is based on print server, and you are mapping to a printer located in the print server.

My task is to install local TCP/IP standard printer on each computer.
if I go to each computer manually I can add printer  through the wizard, select Local then TCP IP standard, then enter hostname , select HP as manufacturer then "HP Universal Printing PCL 6" as driver then enter the print queue name, then finish.

I could not get the printer to install properly with any script I have tried so far.
The problem is , after installing the printer , If I select properties of the printer I get an error that I posted in different question.
If you can try the script in your local computer, if it works then probably it might work on remote computers...I have not been  luck so far

Author

Commented:
i found this link : https://msfn.org/board/topic/26296-installing-network-printers-silently-heres-how/

he talks about exporting the registry on a computer that the printer has been installed successfully, but he did not include in his script  how to replicate that registry to other computers.
CERTIFIED EXPERT

Commented:
>> My task is to install local TCP/IP standard printer on each computer.

Thats new. Cany you use the priunter management *.vbs? Or Powershell?

Author

Commented:
I used Powershell, rundll32 printui  printuientry, and the built-in Vbs scripts [prndrv.vbs, prnprt.vbs, prnmng.vbs]

I was able to get the printer installed the proper driver to show up "HP Universal Printing PCL 6", however if I try to open the properties of the printer I get error, if I try to print test page it does not print....

I have been struggling with this issue for weeks.... and posted several questions about this issue.....I could not find a script that can install a printer properly....

I posted this question : https://www.experts-exchange.com/questions/29167363/A-Script-that-sends-keys-to-open-Wizard-and-create-printer.html
I thought if I can find a script that mimmic the Add Printer Wizard that might resolve the issue

Author

Commented:
will get to this topic sometime in the future

Author

Commented:
Thank you

Explore More ContentExplore courses, solutions, and other research materials related to this topic.