VBScript
VBScript
OptionExplicit
Dim ShellObj, sCathiLoc, sIniFile, sLeft, sFind, pos, boolCathiMode, boolUnicodeMode
set ShellObj =CreateObject("WScript.Shell")
sCathiLoc = EES("%CathiDir%")
sIniFile = FileToString(sCathiLoc +"\BindingOutForBug193413.xml")
'Replace the host name of Microsoft.Test.Ebiz.OpsMan.Scenarios.EquityLoan.EquityLoanOrchestration to none
sFind ="<Host Name=""BizTalkServerApplication"" NTGroupName=""BizTalk Application Users"" Type=""1"" Trusted=""true"" />"
pos =InstrRev(sIniFile, sFind)
sLeft =Left(sIniFile, pos -)
sIniFile =Replace(sIniFile, sFind, "<Host xsi:nil=""true"" />", pos -, )
sIniFile = sLeft + sIniFile
Call StringToFile(sIniFile, sCathiLoc +"\BindingInForBug193413.xml")
'************************************************************
' Utility function to get a enviroment location
'************************************************************
Function EES(EnvVar)
EES = ShellObj.ExpandEnvironmentStrings(EnvVar)
End Function
'************************************************************
' Utility function to read a file into a string
'************************************************************
Function FileToString(sPath)
Dim fso, f
Const ForReading =
Const TristateTrue =-
Set fso =CreateObject("Scripting.FileSystemObject")
if fso.FileExists(sPath) =then
ifnot boolCathiMode then
wscript.echo "Input file doesn't exist: '"& sPath &"'"
else
Call objLog.LogFail(CStr("Input file doesn't exist: '"& sPath &"'"))
endif
WScript.Quit()
endif
if boolUnicodeMode then
Set f = fso.OpenTextFile(sPath, ForReading, false, TristateTrue)
else
Set f = fso.OpenTextFile(sPath, ForReading)
endif
FileToString = f.ReadAll
f.Close
Set f =Nothing
Set fso =Nothing
end Function
'************************************************************
' Utility function to write a string to a file
'************************************************************
Sub StringToFile(sString, sPath)
Dim fso, f, hHandle
Set fso =CreateObject("Scripting.FileSystemObject")
if boolUnicodeMode then
Set f = fso.CreateTextFile(sPath, true, true)
else
Set f = fso.CreateTextFile(sPath, true)
endif
f.Write sString
f.Close
if Err.number <>then
PrintWMIErrorthenExit Err.Description, Err.Number
else
ifnot boolCathiMode then
wscript.echo "Output file is created: '"& sPath &"'"
else
Call objLog.LogInfo(CStr("Output file is created: '"& sPath &"'"))
endif
endif
Set f =Nothing
Set fso =Nothing
end Sub
-----------参考网站------------
http://en.wikipedia.org/wiki/VBScript
Wiki
http://www.w3school.com.cn/vbscript/index.asp
VBScript教程@W3School
http://msdn.microsoft.com/en-us/library/k9z80300(v=VS.85).aspx
Replace Method (VBScript)@MSDN
http://msdn.microsoft.com/en-us/library/hsxyczeb(v=VS.85).aspx
InStrRev Function@MSDN
http://forum.openvpn.eu/viewtopic.php?f=25&t=7266&start=0
Example of ShellObj.ExpandEnvironmentStrings
VBScript的更多相关文章
- 第 3 章 VBScript流程控制
学习导航 if...then...else...end if select case...select end for...next do while ... while wend 3.1 认识流程控 ...
- 第 2 章 VBScript基本概念
学习导航 VBScript 基本知识 变量.常量.数组 算术.逻辑.比较 运算符 2.1 VBScript是什么 VBScript程序语言是Microsoft公司VB(Visual Basic)程序语 ...
- VBScript使用CDO.Message发送邮件
Const Email_From = "from@163.com" Const Password = "password" Const Email_To = & ...
- vbscript调用WMI一键式式发布网站
作为.net开发,在window环境下,不得不熟悉些脚本语言,来减轻些日常开发中所遇到的一些繁杂的事情,比如自动发布网站,自动发布网站等等. WMI windows管理程序接口,可用各种与语言调用,方 ...
- ITF Demo代码(用VBScript构建的接口测试框架)
ITF Demo代码(用VBScript构建的接口测试框架) http://blog.csdn.net/testing_is_believing/article/details/20872629
- VBScript [ 译 ]
VBScript ( Visual Basic Scripting Edition) 使用COM 来和宿主环境交互.从Microsoft Windows 98 开始的所有的微软桌面操作系统的relea ...
- ASP测试代码: <% response.write("helloworld,vbscript!") %>
ASP测试代码: <% response.write("helloworld,vbscript!") %>
- 在C#中调用VBScript和JavaScript等脚本的实现
在C#中调用VBScript.JavaScript等脚本的实现 作者:郑佐 2004-04-26 以前在做工作流(workflow)项目的时候,里面有一项就是在用户制定流程定义时可以编写脚本来控制活动 ...
- VBScript 函数
Date/Time 函数 Conversion 函数 Format 函数 Math 函数 Array 函数 String 函数 其他函数 Date/Time 函数 函数 描述 CDate 把一个有效的 ...
- VBSCRIPT事件绑定(隐式)
很多新版的浏览器都开始不支持VBSCRIPT 所以系统开始不断地有script错误,开始比较多地接触VBSCRIPT vbscript 和javascript 事件绑定的类似方法为 vbscript: ...
随机推荐
- HDU 1520-Anniversary party(树形dp入门)
题意: n个人参加party,已知每人的欢乐值,给出n个人的工作关系树,一个人和他的顶头上司不能同时参加,party达到的最大欢乐值. 分析:dp[i][f],以i为根的子树,f=0,i不参加,f=1 ...
- Channel 详解
java.nio.channels.FileChannel封装了一个文件通道和一个FileChannel对象,这个FileChannel对象提供了读写文件的连接. 1.接口 2.通道操作 a.所有通道 ...
- CSLA.NET 简介
CSLA.NET 据说在国外用的很多,国内介绍这个框架的文章目前网络上能找到的比较早,大多是早期的一些版本的版本的介绍.目前最新版的4.5.6 .版本的整体架构已经有了很大的变化.拟开一个系列,结合〈 ...
- 系统虚拟化学习笔记——PCI设备
内容摘自<系统虚拟化:原理与实现> PCI 总线架构 PCI总线是典型的树结构.把北桥中host-PCI桥看做根,总线中其他PCI-PCI桥,PCI-ISA桥(ISA总线转PCI总线桥)等 ...
- 2016"百度之星" - 初赛(Astar Round2B) 1006 中位数计数
思路:统计当前数左边比它小|大 i个人,相应右边就应该是比它大|小i个人 l数组表示左边i个人的方案 r表示右边i个人的方案 数组下标不可能是负数所以要加n //#pragma comment(lin ...
- Magento 头部的演示信息去除
进入后台: 系统-配置, 然后选择左栏的“设计”, 选择右栏的HTML头信息里面有个“Display Demo Store Notice”, 默认是yes,设置为“no”就可以了.
- 《Data-Intensive Text Processing with mapReduce》读书笔记之一:前言
暑假闲得蛋痒,混混沌沌,开始看<Data-Intensive Text Processing with mapReduce>,尽管有诸多单词不懂,还好六级考多了,虽然至今未过:再加上自己当 ...
- 【noip2005】篝火晚会
题解: 首先我们要知道一个性质: 把长度为n的序列变成目标序列最多需要n个操作 证明1: 我们可以将原序列上每位上的数字向目标序列相同位置的数字连一条有向边 如: 原序列: 1 2 3 目标序列: ...
- Java Collections Framework
集合OR 容器 通常我们会用数组去保存一些基本数据类型,数组是编译器支持的类型,但是数组的一个明显缺点就是具有固定尺寸,而在一般情况下,只有在程序运行的时候,我们才能知道要保存的具体数目. Java类 ...
- 家庭局域网接入Internet
接入Internet 建立宽带连接 步骤一:单击"网络",再属性 步骤二:单击"更改适配器设置" 步骤三:选择"宽带连接" 步骤四:输入 ...