如何在MDT/BDD中写一个自定义的脚本(1)
版权声明:原创作品,允许转载,转载时请务必以超链接形式标明文章 原始出处 、作者信息和本声明。否则将追究法律责任。http://xmuxsp.blog.51cto.com/144876/73841 |
原文:http://blogs.technet.com/benhunter/archive/2007/04/15/bdd-2007-ndash-tips-and-tricks-ndash-how-to-write-a-custom-script.aspx
BDD provides a scripting framework, by leveraging this framework you can write a custom script that can utilize the functionality that BDD provides. This functionality includes a logging, accessing and changing environment variables and a number of utility functions.
BDD提供了脚本构架,你可以利用这套构架来编写定制的脚本,扩展BDD的功能。包括记录日志、访问和改变环境变量以及一些功能函数
Before describing how to create a script it is best to review how the scripts included with BDD are constructed.
在阐述如何创建一个新脚本之前,我们最好来复习一下BDD中的脚本是如何构建的。
The standard BDD script is a WSF file, this allows references to be made to functions that are contained in other scripts. BDD scripts leverage this functionality by referencing a script called “ZTIUtility.vbs”.
标准的BDD脚本是WSF格式的,这允许我们在其他脚本中来使用它。BDD脚本依靠ZTIUtility.vbs来引用这些功能。
Understanding ZTIUtility.vbs
ZTIUtility.vbs is used to initialize the BDD environment and setup classes, these can then be used by scripts that reference it.
ZTIUtility.vbs用于初始化BDD环境和安装类别,然后可以被脚本调用
The script defines a number of standard objects:
Note: You do not need to declare these objects in your script.
注意,你不需要在脚本中声明这些对象
Four classes are defined which perform a number of standard tasks:
有四种用于执行各种标准任务的类:
环境-配置由WMI获得和BDD自身的变量,允许在脚本中直接使用
日志-为所有bdd脚本提供日志记录
功能-提供大部分函数功能
数据库-连接并读取数据库
|


xmuxsp
博客统计信息
热门文章
最新评论
友情链接