按:这个脚本是本人写的基于我现在工作的系统网络环境所做的,主要用意是:在一个非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

原文链接: http://blog.csdn.net/afatgoat/article/details/6073216

转载于:https://my.oschina.net/junwong/blog/46607

Windows: 根据分组的本地TCP/IP打印机的安装(1)相关推荐

  1. xp系统远程计算机需要网络打印机驱动,WinXP手动添加TCP/IP端口及安装打印机驱动(系统向导安装,不需要任何软件)...

    打印机驱动安装,一般情况下我们都建议客人使用"打印机驱动安装助手"安装,但有些电脑运行软件出错:或者是有些客人顾虑软件安全性:或者是服务器版本太老无法支持,所以做这个教程,脱离任何 ...

  2. ISA2004 发布内部TCP/IP打印机

    在一些特殊场合,我们的办事处或合作伙伴可能需要使用我们内网的打印机打印,怎样才能提供打印机的共享服务呢?下面我们一起来探讨一下,这里我以192.168.50.12这台网络打印机为例,进行说明.具体步骤 ...

  3. ip设置 kali 重置_在 Windows 系统中如何重置 TCP/IP 协议堆栈修复网络连接问题

    Internet 在 TCP/IP 协议上工作,如果 TCP/IP 协议堆栈在 Windows 或任何其他操作系统(例如 Linux 或 MacOS)中无法正常工作,则您的 Internet 连接会出 ...

  4. 使用批处理批量安装TCP/ip打印机

    一般来说,安装基于TCP/IP端口的打印机都需要经过两个步骤,第一步是添加TCP/IP端口,第二步是安装打印机驱动程序.    既然要实现无需人工参与批量部署,就肯定离不开脚本或者命令行.好在这些WI ...

  5. Windows NT和2000的TCP/IP设置

    http://www.xhit.cn/html/net/xieyi/jichu/20070702/55169.html TCP/IP是一个广泛使用的广域网协议,在NT和2000系统中,它的一些参数会由 ...

  6. Windows Server 2008之三设置TCP/IP

    Windows Server 2008Windows Server 2008作为网络操作系统的联网肯定是必须的,那么,我们就要考虑如何在Windows Server 2008环境设置网络连接的环境,比 ...

  7. 未配置TCP/IP,必须安装并启用网络适配器

    刚遇到的,想想都头痛的.下面我们一起解决下吧.我上网.找朋友问了好玖,答案也是多多的. 首先看看是怎样的问题 1.  360的断网急救箱 2.  看看这个网址写的:       http://jing ...

  8. win10系统打印服务器,Win10手动添加TCP/IP端口及安装打印机驱动(系统向导安装,不需要任何软件)...

    1.00) 在电脑上添加您的打印机. 1.01) 点击屏幕左下角的小圆圈–输入"-设备和打印机"– 然后点击上面的 设备和打印机. 1.02) 点击"添加打印机" ...

  9. 设置计算机名与TCP/IP协议、设置Windows防火墙。

    一.设置计算机名与TCP/IP协议 1更改计算机名与工作组名. 进入"服务器管理界面",打开"服务器管理仪表盘".2单击窗口左侧"本地服务器" ...

最新文章

  1. noip搜索模拟题 骰子
  2. DirectFB实例1--加载一幅图片
  3. 初始python(二)
  4. c++调用cplex求解例子_视频教程 | 用Python玩转运筹优化求解器IBM CPLEX(二)
  5. nacos服务注册与发现
  6. 201412-1-门禁系统
  7. sa结构组网方式_5G建网:先NSA还是SA?
  8. Qt QSsh 使用 windows Qt实现ssh客户端
  9. 多智能体通信:MAGNet用于深度多智能体强化学习的多智能体图网络
  10. linux eclipse中文设置字体,完美调整Ubuntu下的Eclipse字体及界面显示
  11. linux之调试触摸屏驱动
  12. UVALive 7461 - Separating Pebbles
  13. 电脑dnf,DNF卡顿如何解决_DNF卡顿如何解决 教你调整电脑参数畅玩游戏_52PKDNF
  14. Android 12.0 导航栏Icon图标大小修改
  15. 鸿蒙core是什么,一文看懂HMS Core到底是什么
  16. 简单的《找不同汉字版》,来考考你的眼力吧
  17. Qt:可视化UI设计
  18. 从0开始学Unity做SLG系列(GameFramework框架)
  19. 蓝牙XY-MBD07A与XY-MBT58A互连
  20. .net高级技术——编写自己的Where

热门文章

  1. perp系列之八:其它
  2. zookeeper随堂笔记
  3. Graph Neural Networks: A Review of Methods and Applications(图神经网络:方法与应用综述)
  4. 龙应台--有些事,只能一个人做。
  5. mysql固态硬盘和机械硬盘的区别_SATA和M.2固态硬盘有什么区别
  6. 【系统集成】002-信息系统集成与服务管理
  7. 小白易语言post培训接码登录day03
  8. Ubuntu20.04用gparted软件给/目录 or /home目录扩容 or 压缩
  9. 蚂蚁金服入职考试_阿里巴巴蚂蚁金服面试通过,多久给offer?
  10. 无线路由的beacon interval