WINDOWS: 根据分组的本地TCP/IP打印机的安装
2010年12月13日
@font-face { font-family: "MS 明朝"; }@font-face { font-family: "MS ゴシック"; }@font-face { font-family: "MS ゴシック"; }@font-face { font-family: "Calibri"; }@font-face { font-family: "Cambria"; }p.MsoNormal, li.MsoNormal, div.MsoNormal { margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: Cambria; }p.MsoSubtitle, li.MsoSubtitle, div.MsoSubtitle { margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: Calibri; color: rgb(79, 129, 189); letter-spacing: 0.75pt; font-style: italic; }p.MsoListParagraph, li.MsoListParagraph, div.MsoListParagraph { margin: 0cm 0cm 0.0001pt 36pt; font-size: 12pt; font-family: Cambria; }p.MsoListParagraphCxSpFirst, li.MsoListParagraphCxSpFirst, div.MsoListParagraphCxSpFirst { margin: 0cm 0cm 0.0001pt 36pt; font-size: 12pt; font-family: Cambria; }p.MsoListParagraphCxSpMiddle, li.MsoListParagraphCxSpMiddle, div.MsoListParagraphCxSpMiddle { margin: 0cm 0cm 0.0001pt 36pt; font-size: 12pt; font-family: Cambria; }p.MsoListParagraphCxSpLast, li.MsoListParagraphCxSpLast, div.MsoListParagraphCxSpLast { margin: 0cm 0cm 0.0001pt 36pt; font-size: 12pt; font-family: Cambria; }span.SubtitleChar { font-family: Calibri; color: rgb(79, 129, 189); letter-spacing: 0.75pt; font-style: italic; }.MsoChpDefault { font-family: Cambria; }div.WordSection1 { page: WordSection1; }ol { margin-bottom: 0cm; }ul { margin-bottom: 0cm; } 按:这个脚本是本人写的基于我现在工作的系统网络环境所做的,主要用意是:在一个非Windows服务器管理的网络环境中,提供一种方便的工具,来安装本地的TCP/IP打印机,以方便管理员对打印机的管理。他可以根据计算机的分组信息(分组可以是根据办公室位置来区分,因为打印机都是于位置和权限有关的)以及权限,来安装打印机,这样不同的人员在本台电脑上登录,可以存取到最近的可以打印的打印机,而不是远在其它地方的打印机。
下面是我编写的英文版本的使用说明初稿,还没有在我公司内部发布,先放在我的blog里面。等我有时间再来翻译过来。
Name: SetupIPPrinter (set up Local TCP/IP printer)
Created: May 14, 2010
Updated: Dec 12, 2010
Description:
This program set up TCP/IP printer on a local PC for all users who logged in.
It is used on the following 3 situation but not limited:
School has no server.
School has a Mac server.
School has a PC server, but some AD user groups have to use local TCP/IP printer.
Introduction: In a PC server school, student printing is managed on server and teachers can put network printer connection easily too. In a none-PC server school, school tech may have to set up TCP/IP printer on each PC for teachers and/or students manually for now. Doing this manual setup is a time consuming task, especially for a number of computers. The purpose of this program is to fill the gap to provide a simple and easy way for school tech to set up printer on PCs. On a PC server, we manage menus$ share and put a printer list file in "location" folders which is defined in computers' Location field on AD. This program does the similar way and provides more options. Printer Configuration: Setup a local printer is different from a network printer connection, it asks for model, driver, TCP/IP port, and others. So we must define each printer configuration first. All printer configuration information is stored in a file called PrinterConfig.ini file. Note : if you put /c option in command line, this file name will be changed, for example, /c 212, the file name will be 212_PrinterConfig.ini Define a Printer Configuration file: This file is a standard DOS text file. Each line defines one and only one printer. Each line has the following format: Permission, PrinterName, IP, DriverInfFile, PrinterModel, Location, Comment A comma separates each field. The maximum number of printers is 500. Lines starting with # are comments. Spaces before and behind each field will be ignored. Specification of each field: Permission : either A or S 1. A = All users can print 2. S = Staff only can print PrinterName : The printer name shows in the Printers and Faxes list in XP. IP : A valid IP address or the Printer name which is defined in DNS. Driver's Inf File : The UNC name of a printer driver INF file, it must be in the driver path. If this field="", then system will not install any driver, it assumes The driver exists in system printer cab. Printer Model : The printer model driver name. This name is listed on printer driver list. Locations : Optional, the printer location in the printer Property's Location field. Comment : Optional, the printer comment in the printer Property's Comments field. For example: A, P241LAB1, 10.23.66.2, .\HPUPD\hpcu109c.inf, HP Universal Printing PCL 6, Computer Lab, For All students and Staff It defines a "P241LAB1" printer, whose IP address is 10.23.66.2, the printer driver INF file is in a subfolder "HPUPD", of current folder, file name is hpcu109c.inf, the printer model driver name is "HP Universal Printing PCL 6", the location is "Computer Lab", the comment is "For All students and Staff", and all users(staff and students) can print to it. Location List file: What printers are set up on a computer is determined by it's location. A computer's location can be defined in AD, or in a Location List file. A location List file is a standard DOS text file and each line defines a computer's location. The file name is Locations.ini . Note : if you put /c option in command line, this file name will be changed, for example, /c 212, the file name will be 212_Locations.ini The format of each line is: Location, ComputerName A comma separates each field. Lines starting with # are comments. Spaces before and behind each field will be ignored. Location: The location name. this name is a location file name. ComputerName: The computer name. For example: Office, W999-001 Library, W999-004 Lab, w999-201 What it does? Location Printer List file: Each location of a computer can have a list of printers and a default printer. This file's format is simple. It lists all the printers that this location's computers can access. The file name is the location name, for example, location Library has a location printer list file named "Library.txt". Each printer occupies one line. The printer name must be same as the one in Printer Configuration file. The first printer on the list is the default printer. Spaces before and behind will be ignored. There's a special Location List file, Default.txt . All the computers which doesn't have a location defined, will get printer list from this file. Example of Location Printer list file: P212OFF1 P212LIB1 P212LAB1 Run it, SetupIPPrinter.vbs How it works? It gets computer name, find the computer's location from Locations.ini file, for example, lab; and make the location name as file name to open the location printer list file, lab.txt, and read the printer list, for each printer, read printer configuration PrinterConfig.ini , and then set it up. Usage: cscript PrinterSetup.vbs [options….] /c: define school code, this code is used for configuration files name only. /l [0|1|2]: log message level. Log Level: 0: only system info 1: Error only 2: Error and warning messages 3: All messages /d: Delete all TCP/IP ports and printers first. /p: the full path of configuration files. Default=the same as script's. /?: online help. Please put SetACL.exe file with this script. Put all together: Best practice: 1. Collect all school computers name with locations. 2. Collect all printers and what locations computer will printer to it. 3. Define a location name for each group of computers which have same printers to print. 4. Create printer configuration file, named "PrinterConfig.ini ", and add printers. 5. Update computer location in AD, or add all computers location to "Locations.ini " file, and remember which method you chose. File ot AD? 6. Decide where to save these configuration files, ie. *.txt and *.ini files: On school server share folder? write down the share folder's URL. On a folder on each location machine? write down the location. Save these files to the destination folder. 7. Test it with debug log level to 2 or 3. Check the info messages. Go back to make changes if program reports warnings or errors. 8. Set log level to 0 or 1 when you decide to run program in product environment. 9. Deploy it in WDS or run it on a computer. A complete example: PrinterConfig.ini file: S, P999CPY1, 10.45.66.9, .\HPUPD\hpcu109c.inf, HP Universal Printing PCL 6, WorkRoom near Office, For All Staff only S, P999MFP1, 10.45.66.10, .\Ricoh\oemsetup.inf, PCL6 Driver for Universal Print, Copier Room, For All Staff only S, P999OFF1, 10.45.66.2, .\HPUPD\hpcu109c.inf, HP Universal Printing PCL 6, WorkRoom near Office, For All Staff only A, P999LAB1, 10.45.66.5, .\HPUPD\hpcu109c.inf, HP Universal Printing PCL 6, WorkRoom near Office, For All Staff only Locations.ini file: Office, W999-001 Office, W999-002 Lab, w999-101 Room01, W999-501 Lib, w999-690 Office.txt P99OFF1 P999CPY1 P999MFP1 Default.txt P999LAB1 P999MFP1 P999CPY1 Put all these files in a folder, c:\IPPrinter. Run the program command line: cscript c:\IPPrinter\setupIPPrinter.vbs /l 3 /d
发表评论
-
还原点
2012-01-20 02:22 443还原点 2010年10月23日 什么是还原点: 表 ... -
正则替换 html
2012-01-20 02:22 675正则替换 html 2010年11月16日 protec ... -
如何在Windows XP 的IIS中增加多个站点以及如何增大最大连接数。
2012-01-20 02:22 709如何在Windows XP 的IIS中增加多个站点以及如何增大 ... -
Windows 7的VPC虚拟机自动不与主机时间同步的解决办法
2012-01-20 02:22 655Windows 7的VPC虚拟机自动不与主机时间同步的解决办法 ... -
小升初学习英语的几个技巧分享
2012-01-19 10:12 562小升初学习英语的几个技巧分享 2011年12月29日 小 ... -
想学好英文吗?
2012-01-19 10:12 530想学好英文吗? 2010年11月20日 想 -
《朗读手册》美国50年来唯一销量超过200万册的教育经典
2012-01-19 10:12 599《朗读手册》美国50年来唯一销量超过200万册的教育经典 2 ... -
朗读的记忆
2012-01-19 10:11 613朗读的记忆 2010年11月03日 今天在豆瓣上,新加入 ... -
工作站电脑配件详解(仅以45纳米双路四核至强及NV Quadro FX图形卡为例,还有价格):
2012-01-17 02:53 983工作站电脑配件详解(仅以45纳米双路四核至强及NV Quadr ... -
官方发布 激情世界杯】浩海技术 GHOST XP SP3 世界杯装机特别版★用稳定压倒一切!
2012-01-17 02:52 688官方发布 激情世界杯】 ... -
浩海技术GHOSTXPSP3_2010浪漫圣诞纯净版
2012-01-17 02:52 1269浩海技术GHOSTXPSP3_2010浪漫圣诞纯净版 201 ... -
从韩国去别的国家旅游签证的具体申请流程
2012-01-15 22:28 559从韩国去别的国家旅游 ... -
告别光棍有新法
2012-01-15 22:28 479告别光棍有新法 2011年02月28日 越 ...
相关推荐
基于 tcp/ip 脚本安装 打印机,解决 手动安装的问题
实训(2)Windows环境下TCP/IP协议的配置,TCP/IP诊断.pdf
(1)懂得在Windows系统中进行网络配置; (2)掌握如何在Windows系统中进行TCP/IP协议配置。 (3)熟悉使用ping命令工具来进行测试; (4)熟悉利用ipconfig工具进行测试
第30章 其他的TCP/IP应用程序 363 附录A tcpdump程序 371 附录B 计算机时钟 376 附录C sock程序 378 附录D 部分习题的解答 381 附录E 配置选项 395 附录F 可以免费获得的源代码 406 参考文献 409 缩略语 420
TCP/IP详解卷1:http://download.csdn.net/source/2608318 TCP/IP详解卷2:http://download.csdn.net/source/2608348 TCP/IP详解卷3:http://download.csdn.net/source/2608358 TCP/IP技术大全:...
TCP/IP Architecture, Design and Implementation in Linux 1/5 For All: [Part 1/5] http://download.csdn.net/source/1345609 [Part 2/5] http://download.csdn.net/source/1345649 [Part 3/5] ...
《TCP/IP详解,卷2:实现》英文书名《TCP/IP Illustrated》 由美国传奇人物W.Richard Stevens著 全套共分三卷,另外两卷分别是《TCP/IP详解,卷1:协议》和《TCP/IP详解,卷3:事务过程中的TCP协议,HTTP,NNTP和...
《TCP/IP详解 卷2:实现》完整而详细地介绍了TCP/IP协议是如何实现的。书中给出了约500个图例,15 000行实际操作的C代码,采用举例教学的方法帮助你掌握TCP/IP实现。本书不仅说明了插口API和协议族的关系以及主机...
TCP/IP Architecture, Design and Implementation in Linux 4/5 For All: [Part 1/5] http://download.csdn.net/source/1345609 [Part 2/5] http://download.csdn.net/source/1345649 [Part 3/5] ...
《tcp/ip高效编程:改善网络程序的44个技巧》是tcp/ip 领域的经典著作,对tcp/ip 网络编程中存在的各种问题进行了全面解析,旨在帮助读者深入透彻地理解tcp/ip 网络编程。本书组织方式比较特别,正文部分包括4 章,将...
《TCP/IP详解,卷2:实现》英文书名《TCP/IP Illustrated》 由美国传奇人物W.Richard Stevens著 全套共分三卷,另外两卷分别是《TCP/IP详解,卷1:协议》和《TCP/IP详解,卷3:事务过程中的TCP协议,HTTP,NNTP和...
《TCP/IP详解·卷2:实现》完整而详细地介绍了TCP/IP协议是如何实现的。书中给出了约500个图例,15000行实际操作的C代码,采用举例教学的方法帮助你掌握TCP/IP实现。《TCP/IP详解·卷2:实现》不仅说明了插口API和...
基于tcp/ip用java实现的聊天程序 聊天程序 java tcp 课程设计
作者用Lawrence Berkeley实验室的tcpdump程序来捕获不同操作系统和TCP/IP实现之间传输的不同分组。对tcpdump输出的研究可以帮助理解不同协议如何工作。本书适合作为计算机专业学生学习网络的教材和教师参考书。也...
Cannot create TCP/IP socket(24).原因及解决办法
tcp/ip教程 tcp/ip教程tcp/ip教程tcp/ip教程tcp/ip教程
TCP/IP详解 卷1: 协议 中文版, 文字版,非扫描,只有几M大
《TCP/IP入门经典(第5版)》深入浅出地介绍了TCP/IP协议的入门知识。全书分为6个部分,共24章:首先从TCP/IP基础知识开始;接着着重介绍了TCP/IP协议系统;然后介绍了TCP/IP连网的相关知识;第4部分对TCP/IP中使用的...