The first list defines the useful functions that are available via the oUtility object created by ZTIUtility.vbs:
LocalRootPath() – Returns the path of the root folder 返回根目录路径
LogPath() – Returns the path to the logs folder 返回日志目录
ScriptName() – Returns the name of the current script 返回现在脚本的名称
BootDevice() – Returns the system boot device 返回系统根引导设备
StatePath() – Returns the path of the state store, eg C:\MININT\StateStore 返回状态存储的路径
ScriptDir() – Returns the directory of the current script 返回现在脚本所在的目录
ReadIni(file, section, item) – Reads the specified item from an ini file 从一个ini文件读取特殊的部件
WriteIni( file, section, item, myvalue ) – Writes the specified item to an ini file 把特定的部件写进ini文件
Sections(file) – Reads the sections in an ini file and stores them in an object 读取ini文件中的section并存储到一个对象中
SectionContents(file, section) – Reads the contents of the specified section and stores them in an object 读取特定的section内容,存储到特定的对象里
RunWithHeartbeat(sCmd) – Runs command will providing heartbeat information to logs 运行命令行把心跳信息提供给日志
ComputerName() – Determines the computer name to use for the build process 决定计算机名称
FindFile(sFilename, sFoundPath) – Returns the location of a file by looking in a number of standard locations 寻找标准位置返回一个文件的位置
FindMappedDrive(sServerUNC) – Checks to see if a drive is mapped to the specified UNC path and returns the driver letter 检查是否把一个unc地址映射到盘付上
ValidateConnection(sServerUNC) – Checks you are connected to the server if not then it will try to connect 检查是否连接到某个服务器,没有则进行连接
MapNetworkDrive(sShare, sDomID, sDomPwd) - Maps a drive letter to the sShare UNC path, returns the drive letter, example: "C:", otherwise returns an error string 把一个unc地址映射到一个盘符上,返回盘符
VerifyPathExists(strPath) – Verifies if the specified path exists, returns TRUE if path exists
检查指定路径是否存在,返回true或false
There is also another script that can be referenced for disk utilities, this is called ZTIDiskUtility.vbs. These functions are not class based but can be referenced directly.
GetDiskSize(iDrive) – Returns the size of the specified disk 返回指定盘大小
GetPartitionSize(sDriveLetter) – Returns the size of the specified partition 返回指定分区大小
GetDiskPartitionCount(iDrive) – Returns the number of partitions on a disk, will also log the size of the partitions 返回分区数,并记录分区大小
GetDiskFreeSpace(iDrive) – Returns the free space available on the specified disk返回某个盘的剩余空间
GetNotActiveDrive() – Returns the active drive
GetBootDrive() – Returns the boot partition 返回引导区
MatchPartitionConfiguration(iDriveIndex, iPartitionIndex, sDriveLetter, iMinSizeMB) - Determine drive status as compared to the custom partition config, return codes are - 0 = Partition exists and meets criteria, 1 = Partition exists and does not meet the criteria, -1= Partition does not exist.和自定义分区设置比较,返回0意味着现存分区满足标准,返回1不满足,-1分区不存在
  • 收藏
  • 评论
  • 举报
提问和评论都可以,用心的回复会被更多人看到 评论
发布评论
相关文章