Ask Experts Questions for FREE Help!
Ask    ||    Answer
 
Advanced  
 

Ask QuestionsprogressAnswer QuestionsprogressBuild ReputationprogressBecome an Expert
 
Free Answers in 3 Easy Steps

Register Now
3 Steps

At Ask Me Help Desk you can ask questions in any topic and have them answered for free by our experts. To ask questions or participate in answering them you must register for a free account. By registering you will be able to:
  • Get free answers from experts in any of our 300+ topics.
  • Accept money for answers that you provide.
  • Communicate privately with other members (PM).
  • See fewer ads.

Home > Computers & Technology > Networking   »   Adding network Printers using a Batch file

 
Thread Tools Search this Thread Display Modes
Question
 
 
#1  
Old Aug 19, 2009, 08:04 AM
Mistery1
Junior Member
Mistery1 is offline
 
Join Date: Sep 2008
Posts: 39
Mistery1 See this member's comment history on his/her Profile page.
Adding network Printers using a Batch file

Hi there,

Im hoping this is in the correct category.

I have created a batch file to add network printers to many computers, this is the example

@echo off

cd c:\windows\system32
cscript prnport.vbs -a -r IP_192.168.2.56 -h 192.168.2.56
cscript prnmngr.vbs -a -p "Printer1" -m "Panasonic DP-4182" -r "IP_192.168.2.56"

It runs perfectly, BUT i have a problem if this port(Recommended printer port) does not exist on the machine it will not install the printer.

Any idea how to create a batch file that does this. Basically i need a batch file/ or a asp.net/VB code to install a printer on many machines WITH or WITHOUT the ports being available.

Hope this makes sense. Please can someone help.

Reply With Quote
 
     

Answers
 
 
Old Aug 19, 2009, 10:28 AM   #2  
Network Expert
chuckhole is offline
 
Join Date: Jan 2008
Location: Houston, TX
Posts: 850
chuckhole See this member's comment history on his/her Profile page.
Call chuckhole via Skype™
You may be running into permissions issues. Since this is being performed on the local computer, it is done under the permissions of the logged on user. If the user does not have Administrator level permissions on the computer, they can not install the printer port or the drivers. Power Users will not have the required level of permissions.

You can perform this installation remotely using what you are already doing but by adding the correct switches to the VBScript.

cscript.exe prnport.vbs -a -r PortName -s ComputerName -h IPAddress -q QueueName

Refer to this MS TechNet article for more information on PrnPort.vbs

By doing this remotely, you are performing this using the permissions of your account (which I assume is a Domain Administrator). It is much easier to use a Windows Server for your printers and install the printers as shared devices. The users will only need Power User permissions on their PC's to add the printers and the drivers are centrally managed at the print server for all users.

A good link for scripting is the Microsoft Scripting Guys.
  Reply With Quote
 
     
 
 
Old Aug 19, 2009, 11:17 PM   #3  
Junior Member
Mistery1 is offline
 
Join Date: Sep 2008
Posts: 39
Mistery1 See this member's comment history on his/her Profile page.
Hi there,

Thanks for the reply.

I dont think this has anything to do with permissions because all the machines i have tested so far are domain administrators and they all have the required priviledges.

I dont want to use this batch file remotely. Its just that im creating this to make our IT guys lives easier where they just click the bat file and the printers are installed ON NEW MACHINES instead of using the wizard which is also time consuming.

How i picked up that this code does not install the printers when the ports does not exist is that when the bat file runs it hangs if the port is not there and after a while its says port is unkown, which makes sense because I looked to that specfic port, it does not exist on the machine. When i add the port in via the wizard and then run the bat file, it runs perfectly.

Any ideas on this. Someone please help on this one.

Thanks in advance.
  Reply With Quote
 
     
 
 
Old Aug 20, 2009, 02:46 AM   #4  
Junior Member
Mistery1 is offline
 
Join Date: Sep 2008
Posts: 39
Mistery1 See this member's comment history on his/her Profile page.
Thanks for your help i have the answer. You have to add parameters. check this link out

http://forums.techarena.in/xp-print-fax/449346.htm
  Reply With Quote
 
     
 
 
Old Aug 20, 2009, 12:00 PM   #5  
Network Expert
chuckhole is offline
 
Join Date: Jan 2008
Location: Houston, TX
Posts: 850
chuckhole See this member's comment history on his/her Profile page.
Call chuckhole via Skype™
Quote:
Originally Posted by Mistery1 View Post
Thanks for your help i have the answer. You have to add parameters. check this link out

Adding a printer/port Commandline - Auto installing printers/portd - XP Print Fax
The link I added for the TechNet article describes the use of the PrnPort.vbs file. The Port Name and the IP address of the port are two different things, and as you have discovered, must both be used. Using the remote machine name is the only part of the command line that mentioned in the post above is optional. You are not using LPR printing, so you do not have to specify the port type.

If your infrastrucuture is large enough, why not use a print server instead of installing TCP/IP ports and drivers on each PC? This is good discussion material.
  Reply With Quote
 
     

Your Answer
Email me when someone replies to my answer
Join Login





Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

 
Similar Sponsors


Thread Tools
Show Printable Version Show Printable Version
Email this Page Email this Page

Similar Threads
Creating batch file
(5 replies)
Batch file over LAN
(2 replies)
The foolproof backup batch file!
(4 replies)
Batch File In Dos
(2 replies)
How to network printers?
(2 replies)

Search this Thread

Advanced Search

Bookmarks

Sponsors



Copyright ©2003 - 2009, Ask Me Help Desk.
All times are GMT -8. The time now is 07:51 AM.