标题: [转贴] VBScript脚本压缩单个文件为zip格式 [打印本页]
作者: find 时间: 2012-2-29 23:10 标题: VBScript脚本压缩单个文件为zip格式
- 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
复制代码
http://www.jb51.net/article/29534.htm
欢迎光临 批处理之家 (http://bbs.bathome.net/) |
Powered by Discuz! 7.2 |