如何在MDT/BDD中写一个自定义的脚本(1)

原文: [url]http://blogs.technet.com/benhunter/archive/2007/04/15/bdd-2007-ndash-tips-and-tricks-ndash-how-to-write-a-custom-script.aspx[/url]
 
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:
  • oFSO �C File System Object
  • oShell �C Wscript Shell object
  • oEnv - Process Environment object
  • oNetwork - WScript Network object
Note : You do not need to declare these objects in your script.
注意,你不需要在脚本中声明这些对象 
Four classes are defined which perform a number of standard tasks:
有四种用于执行各种标准任务的类:
  • Environment �C This configures environment variables gather via WMI and BDD rule processing and allows you to reference these directly I from you script
  • Logging �C Provides the logging functionality used by all BDD scripts, creating a single log file for each script and a consolidated log file of all scripts
  • Utility �C Provides general utility functionality
  • Database �C performs functions such as connecting to databases and reading information from databases (See this blog for further information)
环境-配置由WMI获得和BDD自身的变量,允许在脚本中直接使用
日志-为所有bdd脚本提供日志记录
功能-提供大部分函数功能
数据库-连接并读取数据库
 
 
分享至
一键收藏,随时查看,分享好友!
0人
了这篇文章
类别:未分类┆阅读( 0)┆评论( 0) ┆ 返回博主首页┆ 返回博客首页
上一篇 BDD2007部署十大常见问题 下一篇 如何在MDT/BDD中写一个自定义的脚本(2)

相关文章

  • MDT2008驱动管理

职位推荐

  • 后端开发工程师
  • 手机游戏unity3D、C++、C#客户端
  • 高级PHP开发工程师
  • Linux 无线驱动开发工程师
  • 中级JAVA开发工程师

文章评论

 
 

发表评论            

昵  称:
登录  快速注册
验证码:

点击图片可刷新验证码请点击后输入验证码博客过2级,无需填写验证码

内  容:

同时赞一个

每日博报 精彩不止一点关闭

你可能感兴趣的:(脚本,职场,休闲,bdd,MDT)