功能说明
- window操作系统
- 未安装压缩的软件
- 有需要压缩、解压缩文件
- 支持单文件压缩
- 支持目录及子目录压缩
目录结构
![文件目录结构图 文件目录结构图](https://oscimg.oschina.net/oscnet/10e136087edf6e40fc6b8ec5c2b7ea309e6.jpg)
压缩脚本(zip.vbs)
Set objArgs = WScript.Arguments
Zip objArgs(0),objArgs(1)
Sub Zip(ByVal mySourceDir, ByVal myZipFile)
Set fso = CreateObject("Scripting.FileSystemObject")
If fso.GetExtensionName(myZipFile) <> "zip" Then
Exit Sub
ElseIf fso.FolderExists(mySourceDir) Then
FType = "Folder"
ElseIf fso.FileExists(mySourceDir) Then
FType = "File"
FileName = fso.GetFileName(mySourceDir)
FolderPath = Left(mySourceDir, Len(mySourceDir) - Len(FileName))
Else
Exit Sub
End If
Set f = fso.CreateTextFile(myZipFile, True)