Microsoft has some built in code you can run from the command prompt to add network printers to all users. The command you use is this
I have run this code and it works fine. I wanted to make a batch file where it prompts for \\server\name
I thought I had it figured out but everytime I run the code i get an error 1801, which is a connection error. I can just run the CSCRIPT and it installs the printer just fine.
I tried google, but I didn't find anything that could really help me. I'm trying to learn a little scripting so I'm starting on small things and hoping to work my way up to more complicated things. If anybody can help I would appreciate it.
Code:
CSCRIPT %windir%\system32\Printing_Admin_Scripts\en-US\prnmngr.vbs -ac -p "\\server\name"
I have run this code and it works fine. I wanted to make a batch file where it prompts for \\server\name
I thought I had it figured out but everytime I run the code i get an error 1801, which is a connection error. I can just run the CSCRIPT and it installs the printer just fine.
Code:
@Echo Off
set/p p=Printer Name:
CSCRIPT %windir%\System32\Printing_Admin_Scripts\en-US\prnmngr.vbs -ac -p "!p!"
PAUSE
I tried google, but I didn't find anything that could really help me. I'm trying to learn a little scripting so I'm starting on small things and hoping to work my way up to more complicated things. If anybody can help I would appreciate it.