信息发布→ 登录 注册 退出

VBScript压缩单个文件为zip格式

发布时间:2026-01-11

点击量:
复制代码 代码如下:
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
标签:# Error  # CopyHere  # Namespace  # fp  # fso  # targetfile  # oApp  # Dim  # BR  # span  # Resume  # 压缩  # OpenTextFile  # Write  # True  # tmp  # CreateObject  # Set  # FileSystemObject  # Scripting  # zip  
在线客服
服务热线

服务热线

4008888355

微信咨询
二维码
返回顶部
×二维码

截屏,微信识别二维码

打开微信

微信号已复制,请打开微信添加咨询详情!