dim WinRAR = "C:\Program Files\Winrar\" 'winrar安装路径
dim Path1 = "c:\1.xml" '要压缩的文件,路径带空格的话字符串最外面要加两对双引号
dim Path2 = "c:\2.xml" '要压缩的文件,路径带空格的话字符串最外面要加两对双引号
dim RarPath = "D:\2.rar" '生成的压缩文件,路径带空格的话字符串最外面要加两对双引号
Private Sub Command1_Click()
Shell WinRAR & "rar.exe a " & RarPath & " " & Path1 & " " & Path2
End Sub