Link to home
Start Free TrialLog in
Avatar of jskfan
jskfanFlag for Cyprus

asked on

Print Drivers Install with Script

Print Drivers Install with Script

I have used the windows default printer scripts to add printer to remote computer, it works fine. However it does not seem like it installs the specified driver properl.

when I check printer properties it throw a communication error, but still open printer properties, everything seems to be configured as it is supposed to. However when I click to print test page it just freezes.

I would like to know if anything missing and needed to be  added in addition to these scripts:
prnmngr.vbs and prnport.vbs

Probably I need to select "Replace the driver" via script
Thank you
Avatar of Darrell Porter
Darrell Porter
Flag of United States of America image

How are you installing the printer's drivers?
Please provide the script you're using.
Avatar of jskfan

ASKER

I am getting this error after i run the script and install the printer and check printer properties
I believe the script should specify the option "Replace the current driver " instead of "use the driver that is currently installed "

User generated image
for /f %%a in (C:\Scripts\CalledScripts\CompOnly.CSV) do (


	@echo Creating Printer Port on %%a
	cscript.exe "C:\windows\system32\Printing_Admin_Scripts\en-US\prnport.vbs" -a  -s %%a -r "Printerhostname" -h hostname -o raw -n 9100

	@echo Installing Print Drivers on %%a
        cscript.exe C:\Windows\System32\Printing_Admin_Scripts\en-US\prndrvr.vbs -a -r "Printerhostname"  -m "HP Universal Printing PCL 6" -s %%a

	
	 @echo Setting Printer on %%a
	cscript.exe C:\Windows\System32\Printing_Admin_Scripts\en-US\prnmngr.vbs -a  -p "Printer Queue Name" -m "HP Universal Printing PCL 6" -r "Printerhostname" -s %%a
	REM Not really needed, because the script will continue with the next machine
	


)

Open in new window

Avatar of jskfan

ASKER

Can I try a different script to see if it will work ?

Thank you
ASKER CERTIFIED SOLUTION
Avatar of Darrell Porter
Darrell Porter
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of jskfan

ASKER

Even if you change it the way you suggested the printer does get install properly:

@echo Creating Printer Port on %%a
 cscript.exe "C:\windows\system32\Printing_Admin_Scripts\en-US\prnport.vbs" -a  -s %%a -r "Printerhostname" -h hostname -o raw -n 9100


\cscript.exe "C:\windows\system32\Printing_Admin_Scripts\en-US\Prndrvr.vbs" -a   -m "HP Universal Printing PCL 6"  -h "sccm\hp drivers\hpcu230u.inf" -s %%a



@echo Setting Printer on %%a
cscript "C:\Windows\System32\Printing_Admin_Scripts\en-US\prnmngr.vbs" -d -a -p "Printer Queue Name" -m "HP Universal Printing PCL 6" -r "Printerhostname" -s %%a
REM Not really needed, because the script will continue with the next machine

Open in new window


found this link:

https://msfn.org/board/topic/26296-installing-network-printers-silently-heres-how/

however the author did not explain clearly how to deploy the registry file with   the script.
Avatar of jskfan

ASKER

Will et back to this topic sometime