1,利用QTP中SystemUtil.Run的功能,将指定文件压缩成RAR格式。
代码如下:
2,利用VBS:'Zip File or folder 'Example:Zip "C:\temp", "C:\Temp.zip"
Function ZipFile(ByVal mySourceDir, ByVal myZipFile)
Set fso = CreateObject("Scripting.FileSystemObject")
If fso.GetExtensionName(myZipFile) <> "zip" Then
Exit Sub
ElseIf fso.FolderExists(