Ask Experts Questions for FREE Help !
Ask
    Mistery1's Avatar
    Mistery1 Posts: 39, Reputation: 1
    Junior Member
     
    #1

    Aug 19, 2009, 08:04 AM
    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.
    chuckhole's Avatar
    chuckhole Posts: 850, Reputation: 45
    Senior Member
     
    #2

    Aug 19, 2009, 10:28 AM

    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.
    Mistery1's Avatar
    Mistery1 Posts: 39, Reputation: 1
    Junior Member
     
    #3

    Aug 19, 2009, 11:17 PM
    Hi there,

    Thanks for the reply.

    I don't 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 privileges.

    I don't want to use this batch file remotely. Its just that I'm 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 unknown, which makes sense because I looked to that specific 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.
    Mistery1's Avatar
    Mistery1 Posts: 39, Reputation: 1
    Junior Member
     
    #4

    Aug 20, 2009, 02:46 AM
    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
    chuckhole's Avatar
    chuckhole Posts: 850, Reputation: 45
    Senior Member
     
    #5

    Aug 20, 2009, 12:00 PM
    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.

Not your question? Ask your question View similar questions

 

Question Tools Search this Question
Search this Question:

Advanced Search

Add your answer here.


Check out some similar questions!

Creating batch file [ 5 Answers ]

Hi, I have created batch file and saved with .bat from notepad. And I wanted to run that file on startup of my computer but I don't want to see that black DOS window while batch file is running on startup. Is there any other keyword or statements that I can put in batch file that will hide...

Batch file over LAN [ 2 Answers ]

I want to install bat file over lan

The foolproof backup batch file! [ 4 Answers ]

Hi, hope this is the right place to ask about windows XP dos batch files. I fix home PCs for a living and want to make a foolproof backup procedure that runs overnight. I want the user to plug in a USB drive Thursday eve and take it away on Friday with the backup files on it. Im using Acronis...

Batch File In Dos [ 2 Answers ]

How do I make a batch file in dos that will open a program. I need to name the file S The file is acct\prog\solomon\solomon I have this in one PC but forgot how it create the command.

How to network printers? [ 2 Answers ]

Ok, here is my setup... I have 2 desktop PC's, one I use as a "server" the other is for personal use. I also of 3 wireless laptops that are for personal use. I currently have 3 printers and they are hooked up to the "server". I would like to know if I can and how I can use all three printers on all...


View more questions Search