VBScript压缩单个文件为zip格式

所属分类: 脚本专栏 / vbs 阅读数: 349
收藏 0 赞 0 分享
复制代码 代码如下:

On Error Resume Next
Dim fso,fp,oApp,targetfile
Set fso=CreateObject("Scripting.FileSystemObject")
targetfile="D:\tmp.zip"
Set fp=fso.OpenTextFile(targetfile,2,True)
fp.Write Chr(80) & Chr(75) & Chr(5) & Chr(6) & String(18,0)
fp.Close
Set oApp=CreateObject("Shell.Application")
Set fso=Nothing
Err.Clear
oApp.Namespace(targetfile).CopyHere "C:\1.txt"
WScript.Sleep 1000
更多精彩内容其他人还在看

VBS教程:函数-LCase 函数

VBS教程:函数-LCase 函数
收藏 0 赞 0 分享

VBS教程:函数-LBound 函数

VBS教程:函数-LBound 函数
收藏 0 赞 0 分享

VBS教程:函数-Join 函数

返回一个字符串,此字符串由包含在数组中的许多子字符串联接创建
收藏 0 赞 0 分享

VBS教程:函数-IsObject 函数

VBS教程:函数-IsObject 函数
收藏 0 赞 0 分享

VBS教程:函数-IsNumeric 函数

VBS教程:函数-IsNumeric 函数
收藏 0 赞 0 分享

VBS教程:函数-IsNull 函数

VBS教程:函数-IsNull 函数
收藏 0 赞 0 分享

VBS教程:函数-IsEmpty 函数

VBS教程:函数-IsEmpty 函数
收藏 0 赞 0 分享

VBS教程:函数-IsDate 函数

VBS教程:函数-IsDate 函数
收藏 0 赞 0 分享

VBS教程:函数-IsArray 函数

VBS教程:函数-IsArray 函数
收藏 0 赞 0 分享

VBS教程:函数-Int、Fix 函数

VBS教程:函数-Int、Fix 函数
收藏 0 赞 0 分享
查看更多