Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

batch file for creating printers

Posted on 2004-04-01
3
Medium Priority
?
731 Views
Last Modified: 2011-10-25
I would like to know if it's possible to create a batch file to automate the process of creating printers by setting the IP, Name, Location and drivers of the printer.

Thanks a lot
0
Comment
Question by:bomek
  • 2
3 Comments
 
LVL 85

Expert Comment

by:oBdA
ID: 10734629
That would be network printers, probably in a logon script? You can use con2prt.exe from the Zero Administration Toolkit for that (that's for NT4, but still runs fine on W2k and XP).
S{a|i}mple logon script, including mapping depending on group membership:

====8<----[logon.cmd]----
:: *** Delete all mapped printers:
con2prt.exe /f
:: *** Map the printers according to group membership:
ifmember.exe YourDomain\Printer01Group
if not errorlevel 1 goto EndPrinter01Group
con2prt.exe /c \\PrintServer\Printer01
:EndPrinter01Group

ifmember.exe YourDomain\Printer02Group
if not errorlevel 1 goto EndPrinter02Group
con2prt.exe /c \\PrintServer\Printer02
:EndPrinter02Group
====8<----[logon.cmd]----

How to Use Con2prt.exe to Connect to a Network Printer
http://support.microsoft.com/?kbid=181663

Zero Administration Kit
http://www.microsoft.com/ntworkstation/downloads/Recommended/Featured/NTZAK.asp

Resource Kits Free Tool Downloads: Ifmember.exe
http://www.microsoft.com/windows2000/techinfo/reskit/tools/new/ifmember-o.asp
0
 

Author Comment

by:bomek
ID: 10741060
Nope, it's for printer directly using there IP
0
 
LVL 85

Accepted Solution

by:
oBdA earned 1000 total points
ID: 10741580
Then you need rundll32 and the following articles:

How to Add Printers with No User Interaction in Windows
http://support.microsoft.com/?kbid=189105

How to Add Printers with No User Interaction in Windows XP
http://support.microsoft.com/?kbid=314486
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

NTFS file system has been developed by Microsoft that is widely used by Windows NT operating system and its advanced versions. It is the mostly used over FAT file system as it provides superior features like reliability, security, storage, efficienc…
Your business may be under attack from a silent enemy that is hard to detect. It works stealthily in the shadows to access and exploit your critical business information, sensitive confidential data and intellectual property, for commercial gain. T…
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an anti-spam), the admin…
Loops Section Overview

783 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question