What is a fool-proof way to install a local printer on a remote computer (without using prnport.vbs)?
Friday, February 01, 2013 11:01 PM
I work in a BYOC (Bring Your Own Computer) environment, and we have a bunch of network printers that are accessed without the use of a print server. I am looking for a way to install local network printers on computers both on and off the domain, without having to bug the people using them. So far, I have come across the below commands:
Cscript %WINDIR%\System32\Prnport.vbs -a -r IP_IPADDRESS -s \\REMOTEPC -h IPADDRESS
rundll32 printui.dll,PrintUIEntry /ia /c\\REMOTEPC /f "INFFile" /m "EXACTMODELNAME"
rundll32 printui.dll,PrintUIEntry /if /c\\REMOTEPC /z /b "PRINTERNAME" /f " INFFILE" /r "IP_IPADDRESS" /m "EXACTMODELNAME"
The rundll32 commands work beautifully after the port is created, but the cscript prnport.vbs command seldom works right on Windows XP, regardless of whether I run it remotely or via remote desktop. When it launches, it just hangs and hangs forever and does nothing.
Is there an alternative way to install a printer without using prnport.vbs?
Friday, February 01, 2013 11:25 PMAnswerer
There was never a request to have that hang fixed on XP. The issue is in the autodection of the print device. Use the -r parameter to specify raw or lpr, then the other parameters to configure the port.
prnport.vbs -a -h IPADDRESS -o raw -n 9100 -r IPADDRESS -s \\REMOTEPC
Change the settings as required for you device. The port will be created without any validation so make sure you have the correct parameters.
I'm sure you already figured out this works fine on Server 2003 and newer operating systems.
Alan Morris Windows Printing Team
- Marked As Answer by Evosera Monday, February 04, 2013 3:10 PM
Monday, February 04, 2013 3:09 PMThanks for that info! The command ran successfully and the port showed up on the computer. I'll have to test out the whole thing some more when I get a chance. I went ahead and added the printers manually because someone was waiting on it.