We help IT Professionals succeed at work.

prnmngr.vbs  does not create new printer port but it accepts only existing one.

jskfan
jskfan used Ask the Experts™
on
prnmngr.vbs  does not create new printer port but it accepts only existing one.

I am running this command "
C:\>cscript C:\Windows\System32\Printing_Admin_Scripts\en-US\prnmngr.vbs -a  -p
"Myprinter" -m "HP 910" -r "printer1" -s Windows7

Open in new window


I got error:
Unable to add printer Myprinter Error 0x80041001 Generic failure
Operation PutInstance
Provider Win32 Provider
Description The specified port is unknown.
Win32 error code 1796

Open in new window


If I put Existing Port after -r then it will add the printer .
However I an trying to add new printer that did not exist and did not have  an existing  port on the Remote PC

Any  Help?

Thank you
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Most Valuable Expert 2018
Distinguished Expert 2018
Commented:
You need  to create the port before adding the printer to it; that's what prnport.vbs is for.
cscript.exe "C:\windows\system32\Printing_Admin_Scripts\en-US\prnport.vbs" -?

Open in new window

IP port  example for a port named 'printer1':
cscript.exe "C:\windows\system32\Printing_Admin_Scripts\en-US\prnport.vbs" -a  -s Windows7 -r "printer1" -h 1.2.3.4 -o raw -n 9100

Open in new window

Author

Commented:
oBdA

Excellent!!
It worked

Author

Commented:
Excellent !!
Thank you

More question on Printer Scripts coming up