VBScript压缩单个文件为zip格式
2017年03月03日
复制代码 代码如下:
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
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
相关阅读
-
熊猫发行30周年1盎司币价格今天多少一克(2024年05月17日)
-
9999千足金今日价格表(2024年5月17日)
-
第19届杭州亚运会纪念币金银套多少钱(2024年5月17日)
-
工商银行筑梦中华金条100克价格今天多少一克(2024年05月17日)
-
金至尊铂金多少钱一克(2024年05月17日)参考价格
-
2024版熊猫纪念币100克精制金币现在市场价是多少(2024年05月17日)
-
香港六福铂金多少钱一克(2024年05月17日)
-
周六福黄金价格今天多少一克(2024年05月17日)参考价格
-
六福珠宝黄金价格今天多少一克(2024年05月17日)
-
上海老庙黄金价格今天多少一克(2024年05月17日)