URGENT: installing and removing printers
SYS
cmd.exe
“/C ”rundll32 printui.dll,PrintUIEntry /in /n \\srv-print\
/C "rundll32 printui.dll,PrintUIEntry /q /dn /n \\srv-print\Prt-ITMain"
and same for adding. I can push the script and it returns successsful i even see the install happening on the client but printer never gets added.
Answers (3)
I don't know crap about scripting and thought KACE would help with that, but I was still stuck trying to figure out scripting printer installs anyway.
This is crude, but it works for us. If you find it more confusing, just disregard.
Use the shell script option in KACE. In the "Scirpt Text" section, enter the two commands below modified to fit your environment.
---------------------------------------------------------
cscript C:\Windows\SysWOW64\Printing_Admin_Scripts\en-US\prnport.vbs -a -r IP_192.168.1.12 -h 192.168.1.12 -o raw -n 9100
printui.dll,PrintUIEntry /if /b "Xerox7345" /f "\\ShareServer\Printers\Xerox\7345\x64\x2GPINX.inf" /r "IP_192.168.1.12" /m "Xerox WorkCentre 7345 PCL6"
---------------------------------------------------------
may be a little tricky identifing the *.inf, but I always get it form a gunea pig printer install.
The first line sets up the printer port using the windows provided vbs script.
The first set of quotes in the printui.dll line is how users will see the printer.
Second quotes the location of the .inf.
Third quotes points to the printer to the new tcp/ip port.
Forth quotes reference the exact driver name as identified by the inf when your doing a gunea install.
I got it working:
- Launch “SYS\cmd.exe” with params “/C rundll32 printui.dll,PrintUIEntry /q /dn /n \\srv-print\Prt-ITMain”.
- Log “Printer removed Successfully.” to “status”.
- Launch “SYS\cmd.exe” with params “/C rundll32 printui.dll,PrintUIEntry /q /in /n \\srv-print\Prt-ITMain”.
- Log “Printer added Successfully.” to “status”.
- Setup as "Online"
- Checked "run as user logged into console"
The command you are using is only for the user that runs the command, are you running it in system context??
Here is a link to the technet ref which should help..