注册 | 登录 忘记密码? 51cto首页 | 博客 | 论坛 | 招聘
热点文章 情定神州
 帮助

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


2008-05-04 15:56:19
 标签:MDT BDD script   [推送到博客圈]

版权声明:原创作品,允许转载,转载时请务必以超链接形式标明文章 原始出处 、作者信息和本声明。否则将追究法律责任。http://xmuxsp.blog.51cto.com/144876/74801
Now that we have reviewed the framework lets look at how to write a custom script. I have created a script template below which is based on the structure used within the standard BDD scripts. The template is simply a wrapper that references the ZTIUtility.vbs script and  launches the function "ZTIProcess". To create your own script you simply place your code within the ZTIProcess function.
现在我们已经大致了解了构架,让我们来看看如何写一个脚本。我已经写好了一个模板,基于BDD的标准结构。这个模板简单的引用了ZTIUtility.vbs并使用了函数“ZTIProcess”。要建立你自己的脚本,
Here is a quick overview of the steps required to add your script to a BDD build:
  1. Create your script based on the template 基于模板创建你的脚本
  2. Place the script in the folder \Distribution\Scripts 把脚本放在\Distribution\Scripts
  3. Create an Application in the BDD Workbench that references this script 创建一个和脚本有关的应用程序
  4. Add the Application to the build task sequence把程序添加到ts中
It is also important to remember the following key rules when creating your script:
  1. Always declare variables 记得声明你的变量
  2. Only create objects where required - BDD creates most objects you will need需要时才创建对象
  3. Check if ZTIUtitlity provides the functionality you require before writing a function在写一个函数前先看看ZTIUtility是否提供了你需要的
  4. Script names should always start with a "Z" as BDD will replicate only scripts beginning with "Z" to other deployment points脚本名称一定以“Z”开头
Hopefully these tips will get you started, writing your own scripts that  leverage the true flexibility of BDD.




    文章评论
 
 

发表评论

昵   称:
验证码:  点击图片可刷新验证码  博客过2级,无需填写验证码
内   容: