Board logo

标题: [转贴] VBScript脚本压缩单个文件为zip格式 [打印本页]

作者: find    时间: 2012-2-29 23:10     标题: VBScript脚本压缩单个文件为zip格式

  1. On Error Resume Next
  2. Dim fso,fp,oApp,targetfile
  3. Set fso=CreateObject("Scripting.FileSystemObject")
  4. targetfile="D:\tmp.zip"
  5. Set fp=fso.OpenTextFile(targetfile,2,True)
  6. fp.Write Chr(80) & Chr(75) & Chr(5) & Chr(6) & String(18,0)
  7. fp.Close
  8. Set oApp=CreateObject("Shell.Application")
  9. Set fso=Nothing
  10. Err.Clear
  11. oApp.Namespace(targetfile).CopyHere "C:\1.txt"
  12. WScript.Sleep 1000
复制代码

http://www.jb51.net/article/29534.htm




欢迎光临 批处理之家 (http://bbs.bathome.net/) Powered by Discuz! 7.2